identifier
stringlengths
0
89
parameters
stringlengths
0
399
return_statement
stringlengths
0
982
docstring
stringlengths
10
3.04k
docstring_summary
stringlengths
0
3.04k
function
stringlengths
13
25.8k
function_tokens
sequence
start_point
sequence
end_point
sequence
argument_list
null
language
stringclasses
3 values
docstring_language
stringclasses
4 values
docstring_language_predictions
stringclasses
4 values
is_langid_reliable
stringclasses
2 values
is_langid_extra_reliable
bool
1 class
type
stringclasses
9 values
WebController.
null
implémentation d'un IdP
implémentation d'un IdP
@RequestMapping(value = "/idp", method = RequestMethod.GET) @PreAuthorize("isFullyAuthenticated()") public RedirectView idp(final HttpServletRequest request) { final RedirectView redirectView = new RedirectView(); Tools.log("accès à /idp", logger); String ciphertext_hex = request.getParameter("msg"); Tools.log("accès à /idp: requête chiffrée [" + ciphertext_hex + "]", logger); if (ciphertext_hex == null) { Tools.log("accès à /idp: renvoi vers la page d'erreur d'authentification", logger); redirectView.setUrl("/authenticationError"); return redirectView; } final String KEY = oidcAttributes.getIdpKey(); final String IV = oidcAttributes.getIdpIv(); int length1; int length2; try { final byte [] ciphertext = Hex.decodeHex(ciphertext_hex.toCharArray()); // on décrypte la requête URL url; final String plaintext; PaddedBufferedBlockCipher aes = null; GCMBlockCipher gcm = null; final CipherParameters ivAndKey = new ParametersWithIV(new KeyParameter(Hex.decodeHex(KEY.toCharArray())), Hex.decodeHex(IV.toCharArray())); if (!oidcAttributes.getIdpMode().equals("AES-256-GCM")) { aes = new PaddedBufferedBlockCipher(new CBCBlockCipher(new AESEngine()), new PKCS7Padding()); aes.init(false, ivAndKey); final int minSize = aes.getOutputSize(ciphertext.length); final byte [] outBuf = new byte[minSize]; length1 = aes.processBytes(ciphertext, 0, ciphertext.length, outBuf, 0); length2 = aes.doFinal(outBuf, length1); plaintext = new String(outBuf, 0, length1 + length2, Charset.forName("UTF-8")); } else { gcm = new GCMBlockCipher(new AESEngine()); gcm.init(false, ivAndKey); final int minSize = gcm.getOutputSize(ciphertext.length); final byte [] outBuf = new byte[minSize]; length1 = gcm.processBytes(ciphertext, 0, ciphertext.length, outBuf, 0); length2 = gcm.doFinal(outBuf, length1); plaintext = new String(outBuf, 0, length1 + length2, Charset.forName("UTF-8")); } url = new URL(plaintext); Tools.log("accès à /idp: requête déchiffrée [" + url + "]", logger); // on récupère les paramètres nonce et state de l'URL de callback // s'ils sont présents plusieurs fois, on ne récupère que leurs premières instances respectives if (url.getQuery() == null) { Tools.log("accès à /idp: renvoi vers la page d'erreur d'authentification (null query)", logger); redirectView.setUrl("/authenticationError"); return redirectView; } if (plaintext.startsWith(oidcAttributes.getIdpRedirectUri()) == false) { Tools.log("accès à /idp: renvoi vers la page d'erreur d'authentification (url de callback invalide)", logger); redirectView.setUrl("/authenticationError"); return redirectView; } String nonce = null; String state = null; final List<NameValuePair> params = URLEncodedUtils.parse(url.getQuery(), Charset.forName("UTF-8")); for (final NameValuePair param : params) { if (nonce == null && param.getName().equals("nonce")) nonce = param.getValue(); if (state == null && param.getName().equals("state")) state = param.getValue(); if (nonce != null && state != null) break; } // nonce et state sont des paramètres obligatoires // nonce : anti-rejeu // state : protection contre le saut de session if (nonce == null) { Tools.log("accès à /idp: renvoi vers la page d'erreur d'authentification (null nonce)", logger); redirectView.setUrl("/authenticationError"); return redirectView; } if (state == null) { Tools.log("accès à /idp: renvoi vers la page d'erreur d'authentification (null state)", logger); redirectView.setUrl("/authenticationError"); return redirectView; } // on récupère l'identité de l'utilisateur et on y rajoute les paramètres nonce et state final Authentication auth = SecurityContextHolder.getContext().getAuthentication(); final OIDCAuthenticationToken oidcauth = (OIDCAuthenticationToken) auth; final JsonObject gson = oidcauth.getUserInfo().toJson(); gson.addProperty("nonce", nonce); gson.addProperty("state", state); final String info = gson.toString(); final byte [] info_plaintext = info.getBytes(); // on encrypte l'identité de l'utilisateur final String info_ciphertext_hex; if (!oidcAttributes.getIdpMode().equals("AES-256-GCM")) { aes.init(true, ivAndKey); final byte [] inputBuf = new byte[aes.getOutputSize(info_plaintext.length)]; length1 = aes.processBytes(info_plaintext, 0, info_plaintext.length, inputBuf, 0); length2 = aes.doFinal(inputBuf, length1); final byte [] info_ciphertext = ArrayUtils.subarray(inputBuf, 0, length1 + length2); info_ciphertext_hex = new String(Hex.encodeHex(info_ciphertext)); } else { gcm.init(true, ivAndKey); final byte [] inputBuf = new byte[gcm.getOutputSize(info_plaintext.length)]; length1 = gcm.processBytes(info_plaintext, 0, info_plaintext.length, inputBuf, 0); length2 = gcm.doFinal(inputBuf, length1); final byte [] info_ciphertext = ArrayUtils.subarray(inputBuf, 0, length1 + length2); info_ciphertext_hex = new String(Hex.encodeHex(info_ciphertext)); } // on construit l'URL vers laquelle on redirige le navigateur en ajoutant l'identité chiffrée à l'URL de callback indiquée dans la requête final String return_url; if (url.getQuery() == null || url.getQuery().isEmpty()) return_url = plaintext + "?info=" + info_ciphertext_hex; else return_url = plaintext + "&info=" + info_ciphertext_hex; // on redirige l'utilisateur Tools.log("accès à /idp: redirection [" + return_url + "]", logger); redirectView.setUrl(return_url); return redirectView; } catch (final Exception ex) { Tools.log("accès à /idp: exception [" + ex.getStackTrace() + "]", logger); redirectView.setUrl("/authenticationError"); return redirectView; } }
[ "@", "RequestMapping", "(", "value", "=", "\"/idp\"", ",", "method", "=", "RequestMethod", ".", "GET", ")", "@", "PreAuthorize", "(", "\"isFullyAuthenticated()\"", ")", "public", "RedirectView", "idp", "(", "final", "HttpServletRequest", "request", ")", "{", "final", "RedirectView", "redirectView", "=", "new", "RedirectView", "(", ")", ";", "Tools", ".", "log", "(", "\"accès à /idp\", ", "l", "gger);", "", "", "String", "ciphertext_hex", "=", "request", ".", "getParameter", "(", "\"msg\"", ")", ";", "Tools", ".", "log", "(", "\"accès à /idp: requête chiffrée [\" + c", "p", "ertext_hex + \"", "\"", " lo", "g", "er);", "", "", "if", "(", "ciphertext_hex", "==", "null", ")", "{", "Tools", ".", "log", "(", "\"accès à /idp: renvoi vers la page d'erreur d'authentification\", ", "l", "gger);", "", "", "redirectView", ".", "setUrl", "(", "\"/authenticationError\"", ")", ";", "return", "redirectView", ";", "}", "final", "String", "KEY", "=", "oidcAttributes", ".", "getIdpKey", "(", ")", ";", "final", "String", "IV", "=", "oidcAttributes", ".", "getIdpIv", "(", ")", ";", "int", "length1", ";", "int", "length2", ";", "try", "{", "final", "byte", "[", "]", "ciphertext", "=", "Hex", ".", "decodeHex", "(", "ciphertext_hex", ".", "toCharArray", "(", ")", ")", ";", "// on décrypte la requête", "URL", "url", ";", "final", "String", "plaintext", ";", "PaddedBufferedBlockCipher", "aes", "=", "null", ";", "GCMBlockCipher", "gcm", "=", "null", ";", "final", "CipherParameters", "ivAndKey", "=", "new", "ParametersWithIV", "(", "new", "KeyParameter", "(", "Hex", ".", "decodeHex", "(", "KEY", ".", "toCharArray", "(", ")", ")", ")", ",", "Hex", ".", "decodeHex", "(", "IV", ".", "toCharArray", "(", ")", ")", ")", ";", "if", "(", "!", "oidcAttributes", ".", "getIdpMode", "(", ")", ".", "equals", "(", "\"AES-256-GCM\"", ")", ")", "{", "aes", "=", "new", "PaddedBufferedBlockCipher", "(", "new", "CBCBlockCipher", "(", "new", "AESEngine", "(", ")", ")", ",", "new", "PKCS7Padding", "(", ")", ")", ";", "aes", ".", "init", "(", "false", ",", "ivAndKey", ")", ";", "final", "int", "minSize", "=", "aes", ".", "getOutputSize", "(", "ciphertext", ".", "length", ")", ";", "final", "byte", "[", "]", "outBuf", "=", "new", "byte", "[", "minSize", "]", ";", "length1", "=", "aes", ".", "processBytes", "(", "ciphertext", ",", "0", ",", "ciphertext", ".", "length", ",", "outBuf", ",", "0", ")", ";", "length2", "=", "aes", ".", "doFinal", "(", "outBuf", ",", "length1", ")", ";", "plaintext", "=", "new", "String", "(", "outBuf", ",", "0", ",", "length1", "+", "length2", ",", "Charset", ".", "forName", "(", "\"UTF-8\"", ")", ")", ";", "}", "else", "{", "gcm", "=", "new", "GCMBlockCipher", "(", "new", "AESEngine", "(", ")", ")", ";", "gcm", ".", "init", "(", "false", ",", "ivAndKey", ")", ";", "final", "int", "minSize", "=", "gcm", ".", "getOutputSize", "(", "ciphertext", ".", "length", ")", ";", "final", "byte", "[", "]", "outBuf", "=", "new", "byte", "[", "minSize", "]", ";", "length1", "=", "gcm", ".", "processBytes", "(", "ciphertext", ",", "0", ",", "ciphertext", ".", "length", ",", "outBuf", ",", "0", ")", ";", "length2", "=", "gcm", ".", "doFinal", "(", "outBuf", ",", "length1", ")", ";", "plaintext", "=", "new", "String", "(", "outBuf", ",", "0", ",", "length1", "+", "length2", ",", "Charset", ".", "forName", "(", "\"UTF-8\"", ")", ")", ";", "}", "url", "=", "new", "URL", "(", "plaintext", ")", ";", "Tools", ".", "log", "(", "\"accès à /idp: requête déchiffrée [\" + ur", " ", " \"]", ",", "log", "g", "r);", "", "", "// on récupère les paramètres nonce et state de l'URL de callback", "// s'ils sont présents plusieurs fois, on ne récupère que leurs premières instances respectives", "if", "(", "url", ".", "getQuery", "(", ")", "==", "null", ")", "{", "Tools", ".", "log", "(", "\"accès à /idp: renvoi vers la page d'erreur d'authentification (null query)\", ", "l", "gger);", "", "", "redirectView", ".", "setUrl", "(", "\"/authenticationError\"", ")", ";", "return", "redirectView", ";", "}", "if", "(", "plaintext", ".", "startsWith", "(", "oidcAttributes", ".", "getIdpRedirectUri", "(", ")", ")", "==", "false", ")", "{", "Tools", ".", "log", "(", "\"accès à /idp: renvoi vers la page d'erreur d'authentification (url de callback invalide)\", ", "l", "gger);", "", "", "redirectView", ".", "setUrl", "(", "\"/authenticationError\"", ")", ";", "return", "redirectView", ";", "}", "String", "nonce", "=", "null", ";", "String", "state", "=", "null", ";", "final", "List", "<", "NameValuePair", ">", "params", "=", "URLEncodedUtils", ".", "parse", "(", "url", ".", "getQuery", "(", ")", ",", "Charset", ".", "forName", "(", "\"UTF-8\"", ")", ")", ";", "for", "(", "final", "NameValuePair", "param", ":", "params", ")", "{", "if", "(", "nonce", "==", "null", "&&", "param", ".", "getName", "(", ")", ".", "equals", "(", "\"nonce\"", ")", ")", "nonce", "=", "param", ".", "getValue", "(", ")", ";", "if", "(", "state", "==", "null", "&&", "param", ".", "getName", "(", ")", ".", "equals", "(", "\"state\"", ")", ")", "state", "=", "param", ".", "getValue", "(", ")", ";", "if", "(", "nonce", "!=", "null", "&&", "state", "!=", "null", ")", "break", ";", "}", "// nonce et state sont des paramètres obligatoires", "// nonce : anti-rejeu", "// state : protection contre le saut de session", "if", "(", "nonce", "==", "null", ")", "{", "Tools", ".", "log", "(", "\"accès à /idp: renvoi vers la page d'erreur d'authentification (null nonce)\", ", "l", "gger);", "", "", "redirectView", ".", "setUrl", "(", "\"/authenticationError\"", ")", ";", "return", "redirectView", ";", "}", "if", "(", "state", "==", "null", ")", "{", "Tools", ".", "log", "(", "\"accès à /idp: renvoi vers la page d'erreur d'authentification (null state)\", ", "l", "gger);", "", "", "redirectView", ".", "setUrl", "(", "\"/authenticationError\"", ")", ";", "return", "redirectView", ";", "}", "// on récupère l'identité de l'utilisateur et on y rajoute les paramètres nonce et state", "final", "Authentication", "auth", "=", "SecurityContextHolder", ".", "getContext", "(", ")", ".", "getAuthentication", "(", ")", ";", "final", "OIDCAuthenticationToken", "oidcauth", "=", "(", "OIDCAuthenticationToken", ")", "auth", ";", "final", "JsonObject", "gson", "=", "oidcauth", ".", "getUserInfo", "(", ")", ".", "toJson", "(", ")", ";", "gson", ".", "addProperty", "(", "\"nonce\"", ",", "nonce", ")", ";", "gson", ".", "addProperty", "(", "\"state\"", ",", "state", ")", ";", "final", "String", "info", "=", "gson", ".", "toString", "(", ")", ";", "final", "byte", "[", "]", "info_plaintext", "=", "info", ".", "getBytes", "(", ")", ";", "// on encrypte l'identité de l'utilisateur", "final", "String", "info_ciphertext_hex", ";", "if", "(", "!", "oidcAttributes", ".", "getIdpMode", "(", ")", ".", "equals", "(", "\"AES-256-GCM\"", ")", ")", "{", "aes", ".", "init", "(", "true", ",", "ivAndKey", ")", ";", "final", "byte", "[", "]", "inputBuf", "=", "new", "byte", "[", "aes", ".", "getOutputSize", "(", "info_plaintext", ".", "length", ")", "]", ";", "length1", "=", "aes", ".", "processBytes", "(", "info_plaintext", ",", "0", ",", "info_plaintext", ".", "length", ",", "inputBuf", ",", "0", ")", ";", "length2", "=", "aes", ".", "doFinal", "(", "inputBuf", ",", "length1", ")", ";", "final", "byte", "[", "]", "info_ciphertext", "=", "ArrayUtils", ".", "subarray", "(", "inputBuf", ",", "0", ",", "length1", "+", "length2", ")", ";", "info_ciphertext_hex", "=", "new", "String", "(", "Hex", ".", "encodeHex", "(", "info_ciphertext", ")", ")", ";", "}", "else", "{", "gcm", ".", "init", "(", "true", ",", "ivAndKey", ")", ";", "final", "byte", "[", "]", "inputBuf", "=", "new", "byte", "[", "gcm", ".", "getOutputSize", "(", "info_plaintext", ".", "length", ")", "]", ";", "length1", "=", "gcm", ".", "processBytes", "(", "info_plaintext", ",", "0", ",", "info_plaintext", ".", "length", ",", "inputBuf", ",", "0", ")", ";", "length2", "=", "gcm", ".", "doFinal", "(", "inputBuf", ",", "length1", ")", ";", "final", "byte", "[", "]", "info_ciphertext", "=", "ArrayUtils", ".", "subarray", "(", "inputBuf", ",", "0", ",", "length1", "+", "length2", ")", ";", "info_ciphertext_hex", "=", "new", "String", "(", "Hex", ".", "encodeHex", "(", "info_ciphertext", ")", ")", ";", "}", "// on construit l'URL vers laquelle on redirige le navigateur en ajoutant l'identité chiffrée à l'URL de callback indiquée dans la requête", "final", "String", "return_url", ";", "if", "(", "url", ".", "getQuery", "(", ")", "==", "null", "||", "url", ".", "getQuery", "(", ")", ".", "isEmpty", "(", ")", ")", "return_url", "=", "plaintext", "+", "\"?info=\"", "+", "info_ciphertext_hex", ";", "else", "return_url", "=", "plaintext", "+", "\"&info=\"", "+", "info_ciphertext_hex", ";", "// on redirige l'utilisateur", "Tools", ".", "log", "(", "\"accès à /idp: redirection [\" +", "r", "turn_url +", "\"", "\", ", "l", "gger);", "", "", "redirectView", ".", "setUrl", "(", "return_url", ")", ";", "return", "redirectView", ";", "}", "catch", "(", "final", "Exception", "ex", ")", "{", "Tools", ".", "log", "(", "\"accès à /idp: exception [\" +", "e", ".g", "e", "tStackTrace()", " ", "+", "\"", "\", ", "l", "gger);", "", "", "redirectView", ".", "setUrl", "(", "\"/authenticationError\"", ")", ";", "return", "redirectView", ";", "}", "}" ]
[ 124, 1 ]
[ 254, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
CacheInformations.
null
on ne doit pas référencer la classe Statistics dans les déclarations de méthodes (issue 335)
on ne doit pas référencer la classe Statistics dans les déclarations de méthodes (issue 335)
private static long invokeStatisticsMethod(Object statistics, String methodName) { try { // getInMemoryHits, getCacheHits et getCacheMisses existent en v1.2.1 et v1.2.3 // mais avec int comme résultat et existent depuis v1.2.4 avec long comme résultat // donc on cast en Number et non en Integer ou en Long final Number result = (Number) Statistics.class.getMethod(methodName, (Class<?>[]) null) .invoke(statistics, (Object[]) null); return result.longValue(); } catch (final NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (final InvocationTargetException e) { throw new IllegalStateException(e.getCause()); } catch (final IllegalAccessException e) { throw new IllegalStateException(e); } }
[ "private", "static", "long", "invokeStatisticsMethod", "(", "Object", "statistics", ",", "String", "methodName", ")", "{", "try", "{", "// getInMemoryHits, getCacheHits et getCacheMisses existent en v1.2.1 et v1.2.3\r", "// mais avec int comme résultat et existent depuis v1.2.4 avec long comme résultat\r", "// donc on cast en Number et non en Integer ou en Long\r", "final", "Number", "result", "=", "(", "Number", ")", "Statistics", ".", "class", ".", "getMethod", "(", "methodName", ",", "(", "Class", "<", "?", ">", "[", "]", ")", "null", ")", ".", "invoke", "(", "statistics", ",", "(", "Object", "[", "]", ")", "null", ")", ";", "return", "result", ".", "longValue", "(", ")", ";", "}", "catch", "(", "final", "NoSuchMethodException", "e", ")", "{", "throw", "new", "IllegalArgumentException", "(", "e", ")", ";", "}", "catch", "(", "final", "InvocationTargetException", "e", ")", "{", "throw", "new", "IllegalStateException", "(", "e", ".", "getCause", "(", ")", ")", ";", "}", "catch", "(", "final", "IllegalAccessException", "e", ")", "{", "throw", "new", "IllegalStateException", "(", "e", ")", ";", "}", "}" ]
[ 129, 1 ]
[ 144, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
CompetenceService.
null
Modifier une competence
Modifier une competence
public ResponseEntity<Competence> updateCompetence(Competence comp) { System.out.println("Competence à modifier : " + comp); Optional<Competence> comUpadate = this.competenceRepository.findById(comp.getId()); if(comUpadate.isPresent()) { Competence com = comUpadate.get(); com.setNom_competence(comp.getNom_competence()); com.setIdPere(comp.getIdPere()); System.out.println("Competence trouvé!" + com); return new ResponseEntity<>(this.competenceRepository.saveAndFlush(com),HttpStatus.OK); } else { System.out.println("Error competence pas trouvé!"); return new ResponseEntity<>(HttpStatus.NOT_FOUND); } }
[ "public", "ResponseEntity", "<", "Competence", ">", "updateCompetence", "(", "Competence", "comp", ")", "{", "System", ".", "out", ".", "println", "(", "\"Competence à modifier : \" ", " ", "omp)", ";", "", "Optional", "<", "Competence", ">", "comUpadate", "=", "this", ".", "competenceRepository", ".", "findById", "(", "comp", ".", "getId", "(", ")", ")", ";", "if", "(", "comUpadate", ".", "isPresent", "(", ")", ")", "{", "Competence", "com", "=", "comUpadate", ".", "get", "(", ")", ";", "com", ".", "setNom_competence", "(", "comp", ".", "getNom_competence", "(", ")", ")", ";", "com", ".", "setIdPere", "(", "comp", ".", "getIdPere", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"Competence trouvé!\" ", " ", "om)", ";", "", "return", "new", "ResponseEntity", "<>", "(", "this", ".", "competenceRepository", ".", "saveAndFlush", "(", "com", ")", ",", "HttpStatus", ".", "OK", ")", ";", "}", "else", "{", "System", ".", "out", ".", "println", "(", "\"Error competence pas trouvé!\")", ";", "", "return", "new", "ResponseEntity", "<>", "(", "HttpStatus", ".", "NOT_FOUND", ")", ";", "}", "}" ]
[ 25, 4 ]
[ 43, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
Main.
null
Injecte le nom du template dans les scripts bash
Injecte le nom du template dans les scripts bash
private static void creerBashScripts() throws IOException { File unzip = new File("src/main/resources/unzip.sh"); String unzipScript = "cd src/main/resources\n" + "mkdir XXX\n" + "mv XXX.zip ./XXX\n" + "cd XXX\n" + "unzip -n XXX.zip\n" + "rm XXX.zip\n"; File zip = new File("src/main/resources/zip.sh"); String zipScript = "cd src/main/resources/XXX\n" + "zip -r XXX.zip ./*\n" + "mv XXX.zip ../\n" + "rm -rf XXX"; unzipScript = unzipScript.replaceAll("XXX", TEMPLATE_NAME); zipScript = zipScript.replaceAll("XXX", TEMPLATE_NAME); BufferedWriter writer = new BufferedWriter(new FileWriter(unzip.getPath())); writer.write(unzipScript); writer.close(); writer = new BufferedWriter(new FileWriter(zip.getPath())); writer.write(zipScript); writer.close(); }
[ "private", "static", "void", "creerBashScripts", "(", ")", "throws", "IOException", "{", "File", "unzip", "=", "new", "File", "(", "\"src/main/resources/unzip.sh\"", ")", ";", "String", "unzipScript", "=", "\"cd src/main/resources\\n\"", "+", "\"mkdir XXX\\n\"", "+", "\"mv XXX.zip ./XXX\\n\"", "+", "\"cd XXX\\n\"", "+", "\"unzip -n XXX.zip\\n\"", "+", "\"rm XXX.zip\\n\"", ";", "File", "zip", "=", "new", "File", "(", "\"src/main/resources/zip.sh\"", ")", ";", "String", "zipScript", "=", "\"cd src/main/resources/XXX\\n\"", "+", "\"zip -r XXX.zip ./*\\n\"", "+", "\"mv XXX.zip ../\\n\"", "+", "\"rm -rf XXX\"", ";", "unzipScript", "=", "unzipScript", ".", "replaceAll", "(", "\"XXX\"", ",", "TEMPLATE_NAME", ")", ";", "zipScript", "=", "zipScript", ".", "replaceAll", "(", "\"XXX\"", ",", "TEMPLATE_NAME", ")", ";", "BufferedWriter", "writer", "=", "new", "BufferedWriter", "(", "new", "FileWriter", "(", "unzip", ".", "getPath", "(", ")", ")", ")", ";", "writer", ".", "write", "(", "unzipScript", ")", ";", "writer", ".", "close", "(", ")", ";", "writer", "=", "new", "BufferedWriter", "(", "new", "FileWriter", "(", "zip", ".", "getPath", "(", ")", ")", ")", ";", "writer", ".", "write", "(", "zipScript", ")", ";", "writer", ".", "close", "(", ")", ";", "}" ]
[ 51, 4 ]
[ 78, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
CounterStorage.
null
cette méthode est utilisée dans l'ihm Swing
cette méthode est utilisée dans l'ihm Swing
public static void disableStorage() { storageDisabled = true; }
[ "public", "static", "void", "disableStorage", "(", ")", "{", "storageDisabled", "=", "true", ";", "}" ]
[ 224, 1 ]
[ 226, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
ChildOne.
null
backref des traitements de masse d'une �tape
backref des traitements de masse d'une �tape
public boolean isChargerSpecifiqueEDP() { return chargerSpecifiqueEDP; }
[ "public", "boolean", "isChargerSpecifiqueEDP", "(", ")", "{", "return", "chargerSpecifiqueEDP", ";", "}" ]
[ 16, 4 ]
[ 18, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
CompetenceService.
null
Retourne la liste des competences
Retourne la liste des competences
public List<Competence> getAllCompetence() { return competenceRepository.findAll(); }
[ "public", "List", "<", "Competence", ">", "getAllCompetence", "(", ")", "{", "return", "competenceRepository", ".", "findAll", "(", ")", ";", "}" ]
[ 53, 4 ]
[ 55, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
NoteSQLiteOpenHelper.
null
Utilisé pout initialiser la BD
Utilisé pout initialiser la BD
public void addNote(Note note, SQLiteDatabase db) { ContentValues cv = new ContentValues(); cv.put(noteTable.COLUMN_NAME, note.getNote()); cv.put(noteTable.COLUMN_VALUE, note.getValue()); cv.put(noteTable.COLUMN_CATEGORY, note.getCategory()); db.insert(noteTable.TABLE_NAME, null, cv); }
[ "public", "void", "addNote", "(", "Note", "note", ",", "SQLiteDatabase", "db", ")", "{", "ContentValues", "cv", "=", "new", "ContentValues", "(", ")", ";", "cv", ".", "put", "(", "noteTable", ".", "COLUMN_NAME", ",", "note", ".", "getNote", "(", ")", ")", ";", "cv", ".", "put", "(", "noteTable", ".", "COLUMN_VALUE", ",", "note", ".", "getValue", "(", ")", ")", ";", "cv", ".", "put", "(", "noteTable", ".", "COLUMN_CATEGORY", ",", "note", ".", "getCategory", "(", ")", ")", ";", "db", ".", "insert", "(", "noteTable", ".", "TABLE_NAME", ",", "null", ",", "cv", ")", ";", "}" ]
[ 332, 4 ]
[ 338, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
Ardoise.
null
Initialise la barre d'outils
Initialise la barre d'outils
private void initToolBar(){ JPanel panneau = new JPanel(); square.addActionListener(fListener); circle.addActionListener(fListener); red.addActionListener(cListener); green.addActionListener(cListener); blue.addActionListener(cListener); toolBar.add(square); toolBar.add(circle); toolBar.addSeparator(); toolBar.add(red); toolBar.add(blue); toolBar.add(green); this.getContentPane().add(toolBar, BorderLayout.NORTH); }
[ "private", "void", "initToolBar", "(", ")", "{", "JPanel", "panneau", "=", "new", "JPanel", "(", ")", ";", "square", ".", "addActionListener", "(", "fListener", ")", ";", "circle", ".", "addActionListener", "(", "fListener", ")", ";", "red", ".", "addActionListener", "(", "cListener", ")", ";", "green", ".", "addActionListener", "(", "cListener", ")", ";", "blue", ".", "addActionListener", "(", "cListener", ")", ";", "toolBar", ".", "add", "(", "square", ")", ";", "toolBar", ".", "add", "(", "circle", ")", ";", "toolBar", ".", "addSeparator", "(", ")", ";", "toolBar", ".", "add", "(", "red", ")", ";", "toolBar", ".", "add", "(", "blue", ")", ";", "toolBar", ".", "add", "(", "green", ")", ";", "this", ".", "getContentPane", "(", ")", ".", "add", "(", "toolBar", ",", "BorderLayout", ".", "NORTH", ")", ";", "}" ]
[ 120, 8 ]
[ 138, 9 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
CompteARebour.
null
à utiliser plustard ! (Ignorer pour l'instant !
à utiliser plustard ! (Ignorer pour l'instant !
@Override public void propertyChange(PropertyChangeEvent pce) { // throw new UnsupportedOperationException("Not supported yet."); //To change // body of generated methods, choose Tools | Templates. }
[ "@", "Override", "public", "void", "propertyChange", "(", "PropertyChangeEvent", "pce", ")", "{", "// throw new UnsupportedOperationException(\"Not supported yet.\"); //To change", "// body of generated methods, choose Tools | Templates.", "}" ]
[ 38, 4 ]
[ 42, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
HtmlJavaInformationsReport.
null
méthode inspirée de VisualScoreTag dans LambdaProbe/JStripe (Licence GPL)
méthode inspirée de VisualScoreTag dans LambdaProbe/JStripe (Licence GPL)
static String toBar(double percentValue) { // NOPMD final double myPercent = Math.max(Math.min(percentValue, 100d), 0d); final StringBuilder sb = new StringBuilder(); final String body = "<img src=''?resource=bar/rb_{0}.gif'' alt=''+'' title=''" + I18N.createPercentFormat().format(myPercent) + "%'' />"; final int fullBlockCount = (int) Math.floor(myPercent / (UNIT_SIZE * PARTIAL_BLOCKS)); final int partialBlockIndex = (int) Math .floor((myPercent - fullBlockCount * UNIT_SIZE * PARTIAL_BLOCKS) / UNIT_SIZE); sb.append(MessageFormat.format(body, fullBlockCount > 0 || partialBlockIndex > 0 ? "a" : "a0")); final String fullBody = MessageFormat.format(body, PARTIAL_BLOCKS); for (int i = 0; i < fullBlockCount; i++) { sb.append(fullBody); } if (partialBlockIndex > 0) { final String partialBody = MessageFormat.format(body, partialBlockIndex); sb.append(partialBody); } final int emptyBlocks = FULL_BLOCKS - fullBlockCount - (partialBlockIndex > 0 ? 1 : 0); final String emptyBody = MessageFormat.format(body, 0); for (int i = 0; i < emptyBlocks; i++) { sb.append(emptyBody); } sb.append(MessageFormat.format(body, fullBlockCount == FULL_BLOCKS ? "b" : "b0")); return sb.toString(); }
[ "static", "String", "toBar", "(", "double", "percentValue", ")", "{", "// NOPMD\r", "final", "double", "myPercent", "=", "Math", ".", "max", "(", "Math", ".", "min", "(", "percentValue", ",", "100d", ")", ",", "0d", ")", ";", "final", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "final", "String", "body", "=", "\"<img src=''?resource=bar/rb_{0}.gif'' alt=''+'' title=''\"", "+", "I18N", ".", "createPercentFormat", "(", ")", ".", "format", "(", "myPercent", ")", "+", "\"%'' />\"", ";", "final", "int", "fullBlockCount", "=", "(", "int", ")", "Math", ".", "floor", "(", "myPercent", "/", "(", "UNIT_SIZE", "*", "PARTIAL_BLOCKS", ")", ")", ";", "final", "int", "partialBlockIndex", "=", "(", "int", ")", "Math", ".", "floor", "(", "(", "myPercent", "-", "fullBlockCount", "*", "UNIT_SIZE", "*", "PARTIAL_BLOCKS", ")", "/", "UNIT_SIZE", ")", ";", "sb", ".", "append", "(", "MessageFormat", ".", "format", "(", "body", ",", "fullBlockCount", ">", "0", "||", "partialBlockIndex", ">", "0", "?", "\"a\"", ":", "\"a0\"", ")", ")", ";", "final", "String", "fullBody", "=", "MessageFormat", ".", "format", "(", "body", ",", "PARTIAL_BLOCKS", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fullBlockCount", ";", "i", "++", ")", "{", "sb", ".", "append", "(", "fullBody", ")", ";", "}", "if", "(", "partialBlockIndex", ">", "0", ")", "{", "final", "String", "partialBody", "=", "MessageFormat", ".", "format", "(", "body", ",", "partialBlockIndex", ")", ";", "sb", ".", "append", "(", "partialBody", ")", ";", "}", "final", "int", "emptyBlocks", "=", "FULL_BLOCKS", "-", "fullBlockCount", "-", "(", "partialBlockIndex", ">", "0", "?", "1", ":", "0", ")", ";", "final", "String", "emptyBody", "=", "MessageFormat", ".", "format", "(", "body", ",", "0", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "emptyBlocks", ";", "i", "++", ")", "{", "sb", ".", "append", "(", "emptyBody", ")", ";", "}", "sb", ".", "append", "(", "MessageFormat", ".", "format", "(", "body", ",", "fullBlockCount", "==", "FULL_BLOCKS", "?", "\"b\"", ":", "\"b0\"", ")", ")", ";", "return", "sb", ".", "toString", "(", ")", ";", "}" ]
[ 385, 1 ]
[ 415, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
MyTerrierFriendsAction.
null
Supprime des amis
Supprime des amis
public ActionForward deleteFriends( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { final MyTerrierFriendsForm myForm = (MyTerrierFriendsForm) form; final User user = SessionTools.getUserFromSession(request); if (myForm.getCheckListFriends() != null) { for (final String s : myForm.getCheckListFriends()) { final long friendId = Long.parseLong(s); final User friend = Factories.USER.find(friendId); if (friend != null) { Contact theContactRemove = null; for (final Contact thecontact : user.getAllContacts()) { if (thecontact.getContact().getId().equals(friend.getId())) { thecontact.delete(); theContactRemove = thecontact; } } if (theContactRemove != null) { user.removeContact(theContactRemove); } } } } return load(mapping, form, request, response); }
[ "public", "ActionForward", "deleteFriends", "(", "ActionMapping", "mapping", ",", "ActionForm", "form", ",", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "{", "final", "MyTerrierFriendsForm", "myForm", "=", "(", "MyTerrierFriendsForm", ")", "form", ";", "final", "User", "user", "=", "SessionTools", ".", "getUserFromSession", "(", "request", ")", ";", "if", "(", "myForm", ".", "getCheckListFriends", "(", ")", "!=", "null", ")", "{", "for", "(", "final", "String", "s", ":", "myForm", ".", "getCheckListFriends", "(", ")", ")", "{", "final", "long", "friendId", "=", "Long", ".", "parseLong", "(", "s", ")", ";", "final", "User", "friend", "=", "Factories", ".", "USER", ".", "find", "(", "friendId", ")", ";", "if", "(", "friend", "!=", "null", ")", "{", "Contact", "theContactRemove", "=", "null", ";", "for", "(", "final", "Contact", "thecontact", ":", "user", ".", "getAllContacts", "(", ")", ")", "{", "if", "(", "thecontact", ".", "getContact", "(", ")", ".", "getId", "(", ")", ".", "equals", "(", "friend", ".", "getId", "(", ")", ")", ")", "{", "thecontact", ".", "delete", "(", ")", ";", "theContactRemove", "=", "thecontact", ";", "}", "}", "if", "(", "theContactRemove", "!=", "null", ")", "{", "user", ".", "removeContact", "(", "theContactRemove", ")", ";", "}", "}", "}", "}", "return", "load", "(", "mapping", ",", "form", ",", "request", ",", "response", ")", ";", "}" ]
[ 87, 1 ]
[ 118, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
RemoteCall.
null
utilisée dans scripts Jenkins par exemple
utilisée dans scripts Jenkins par exemple
String collectMBeanAttribute(String jmxValueParameter) throws IOException { final URL mbeanAttributeUrl = new URL( url.toString() + '&' + HttpParameter.JMX_VALUE + '=' + jmxValueParameter); return collectForUrl(mbeanAttributeUrl); }
[ "String", "collectMBeanAttribute", "(", "String", "jmxValueParameter", ")", "throws", "IOException", "{", "final", "URL", "mbeanAttributeUrl", "=", "new", "URL", "(", "url", ".", "toString", "(", ")", "+", "'", "'", "+", "HttpParameter", ".", "JMX_VALUE", "+", "'", "'", "+", "jmxValueParameter", ")", ";", "return", "collectForUrl", "(", "mbeanAttributeUrl", ")", ";", "}" ]
[ 78, 1 ]
[ 82, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
LegendEditorComponent.
null
Retourne une couleur
Retourne une couleur
private Color createColor(final Color c1, final Color c2) { Color cMoy = ColorTools.gradiant(c1, c2, .5); return cMoy; }
[ "private", "Color", "createColor", "(", "final", "Color", "c1", ",", "final", "Color", "c2", ")", "{", "Color", "cMoy", "=", "ColorTools", ".", "gradiant", "(", "c1", ",", "c2", ",", ".5", ")", ";", "return", "cMoy", ";", "}" ]
[ 304, 4 ]
[ 307, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
AbstractSliderComponentForTimeSlider.
null
dessine un cursseur dont le centre en X est centerX, et le centre en Y est centerY
dessine un cursseur dont le centre en X est centerX, et le centre en Y est centerY
public static void drawCursor(final Graphics2D g, final Color fillColor, final Color drawColor, final int centerX, final int centerY) { Graphics2D g2 = (Graphics2D) g.create(); g2.setColor(fillColor); g2.fillRoundRect(centerX - CURSOR_W / 2, centerY - CURSOR_H / 2, CURSOR_W, CURSOR_H, ARC_SIZE, ARC_SIZE); g2.setColor(drawColor); g2.drawRoundRect(centerX - CURSOR_W / 2, centerY - CURSOR_H / 2, CURSOR_W, CURSOR_H, ARC_SIZE, ARC_SIZE); g2.dispose(); }
[ "public", "static", "void", "drawCursor", "(", "final", "Graphics2D", "g", ",", "final", "Color", "fillColor", ",", "final", "Color", "drawColor", ",", "final", "int", "centerX", ",", "final", "int", "centerY", ")", "{", "Graphics2D", "g2", "=", "(", "Graphics2D", ")", "g", ".", "create", "(", ")", ";", "g2", ".", "setColor", "(", "fillColor", ")", ";", "g2", ".", "fillRoundRect", "(", "centerX", "-", "CURSOR_W", "/", "2", ",", "centerY", "-", "CURSOR_H", "/", "2", ",", "CURSOR_W", ",", "CURSOR_H", ",", "ARC_SIZE", ",", "ARC_SIZE", ")", ";", "g2", ".", "setColor", "(", "drawColor", ")", ";", "g2", ".", "drawRoundRect", "(", "centerX", "-", "CURSOR_W", "/", "2", ",", "centerY", "-", "CURSOR_H", "/", "2", ",", "CURSOR_W", ",", "CURSOR_H", ",", "ARC_SIZE", ",", "ARC_SIZE", ")", ";", "g2", ".", "dispose", "(", ")", ";", "}" ]
[ 90, 4 ]
[ 98, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
Vector3f.
null
/* Théorème de Pythagore utlisé ici 2D = L = Longueur = X² + Y² 3D = L = Longueur = X² + Y² + Z² sqrt = racine carrée
/* Théorème de Pythagore utlisé ici 2D = L = Longueur = X² + Y² 3D = L = Longueur = X² + Y² + Z²
public float length() { return (float) Math.sqrt(x * x + y * y + z * z); }
[ "public", "float", "length", "(", ")", "{", "return", "(", "float", ")", "Math", ".", "sqrt", "(", "x", "*", "x", "+", "y", "*", "y", "+", "z", "*", "z", ")", ";", "}" ]
[ 33, 1 ]
[ 36, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
DebugOutput.
null
TODO: à revoir, incomplet et inefficace
TODO: à revoir, incomplet et inefficace
public static String textToHtml(String inText) { // does almost nothing for now... inText = strReplace(inText,"&","&amp;"); inText = strReplace(inText,"'","&apos;"); inText = strReplace(inText,"\"","&quot;"); inText = strReplace(inText,"<","&lt;"); inText = strReplace(inText,">","&gt;"); // when we're not normalized (which we should be able to know here), // escape \n inText = strReplace(inText,"\n","\\n"); return inText; }
[ "public", "static", "String", "textToHtml", "(", "String", "inText", ")", "{", "// does almost nothing for now...\r", "inText", "=", "strReplace", "(", "inText", ",", "\"&\"", ",", "\"&amp;\"", ")", ";", "inText", "=", "strReplace", "(", "inText", ",", "\"'\"", ",", "\"&apos;\"", ")", ";", "inText", "=", "strReplace", "(", "inText", ",", "\"\\\"\"", ",", "\"&quot;\"", ")", ";", "inText", "=", "strReplace", "(", "inText", ",", "\"<\"", ",", "\"&lt;\"", ")", ";", "inText", "=", "strReplace", "(", "inText", ",", "\">\"", ",", "\"&gt;\"", ")", ";", "// when we're not normalized (which we should be able to know here),\r", "// escape \\n\r", "inText", "=", "strReplace", "(", "inText", ",", "\"\\n\"", ",", "\"\\\\n\"", ")", ";", "return", "inText", ";", "}" ]
[ 173, 4 ]
[ 187, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
ContenusRightPolicyFilter.
null
/* Teste si le membre fait partie du groupe de lecteurs privilégiés, autorisés à consulter les contenus réservés.
/* Teste si le membre fait partie du groupe de lecteurs privilégiés, autorisés à consulter les contenus réservés.
public static boolean isLecteurAutorise(Member mbr){ Group group = channel.getGroup("$jcmsplugin.observatoire.contenusAgents.group"); if(Util.notEmpty(mbr) && Util.notEmpty(group) && mbr.belongsToGroup(group)){ return true; } return false; }
[ "public", "static", "boolean", "isLecteurAutorise", "(", "Member", "mbr", ")", "{", "Group", "group", "=", "channel", ".", "getGroup", "(", "\"$jcmsplugin.observatoire.contenusAgents.group\"", ")", ";", "if", "(", "Util", ".", "notEmpty", "(", "mbr", ")", "&&", "Util", ".", "notEmpty", "(", "group", ")", "&&", "mbr", ".", "belongsToGroup", "(", "group", ")", ")", "{", "return", "true", ";", "}", "return", "false", ";", "}" ]
[ 76, 1 ]
[ 83, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
Tri_Exercice.
null
tri par sélection
tri par sélection
public static void main(String [] args){ int [] t = {7, 15, 45, 53, 26}; int i, j, min, cpt, temp; cpt = 5; for (i=0; i< cpt -1; i++){ min = i; for( j= i+1 ; j< cpt; j++){ if(t[j]< t[min]) min = j; } if(min !=i){ if(min != i){ temp = t[min]; t [min] = t[i]; t[i] = temp; for(j = 0; j<cpt; j++)System.out.print(t[j] + " "); System.out.println(); } }}}
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "int", "[", "]", "t", "=", "{", "7", ",", "15", ",", "45", ",", "53", ",", "26", "}", ";", "int", "i", ",", "j", ",", "min", ",", "cpt", ",", "temp", ";", "cpt", "=", "5", ";", "for", "(", "i", "=", "0", ";", "i", "<", "cpt", "-", "1", ";", "i", "++", ")", "{", "min", "=", "i", ";", "for", "(", "j", "=", "i", "+", "1", ";", "j", "<", "cpt", ";", "j", "++", ")", "{", "if", "(", "t", "[", "j", "]", "<", "t", "[", "min", "]", ")", "min", "=", "j", ";", "}", "if", "(", "min", "!=", "i", ")", "{", "if", "(", "min", "!=", "i", ")", "{", "temp", "=", "t", "[", "min", "]", ";", "t", "[", "min", "]", "=", "t", "[", "i", "]", ";", "t", "[", "i", "]", "=", "temp", ";", "for", "(", "j", "=", "0", ";", "j", "<", "cpt", ";", "j", "++", ")", "System", ".", "out", ".", "print", "(", "t", "[", "j", "]", "+", "\" \"", ")", ";", "System", ".", "out", ".", "println", "(", ")", ";", "}", "}", "}", "}" ]
[ 4, 1 ]
[ 29, 3 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
Trackball.
null
Trouve le point de la sphere le plus proche de c
Trouve le point de la sphere le plus proche de c
public static Point3D closest(final Point3D c, final Sphere3D sph, final Point3D result) { Ray3D ray2 = new Ray3D(sph.center, c); return ray2.getParametricPosition(sph.radius, result); }
[ "public", "static", "Point3D", "closest", "(", "final", "Point3D", "c", ",", "final", "Sphere3D", "sph", ",", "final", "Point3D", "result", ")", "{", "Ray3D", "ray2", "=", "new", "Ray3D", "(", "sph", ".", "center", ",", "c", ")", ";", "return", "ray2", ".", "getParametricPosition", "(", "sph", ".", "radius", ",", "result", ")", ";", "}" ]
[ 43, 1 ]
[ 46, 9 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
AdjacencyFinder.
null
obtient les adjacences transitives satifaisant toutes le prédicat
obtient les adjacences transitives satifaisant toutes le prédicat
protected static List<Intersection> findFromPredicate( Intersection i, Board b, Predicate<Intersection> predicate ) { Stack<Intersection> aTraiter = new Stack<Intersection>(); List<Intersection> traite = new ArrayList<Intersection>(); List<Intersection> resultat = new ArrayList<Intersection>(); aTraiter.push(i); while(!aTraiter.isEmpty()) { Intersection intersection = aTraiter.pop(); if(!traite.contains(intersection)) { traite.add(intersection); Optional<Color> c = intersection.getOccupation(); if(predicate.test(intersection)){ aTraiter.addAll(intersection.getNeighbors(b)); resultat.add(intersection); } } } return resultat; }
[ "protected", "static", "List", "<", "Intersection", ">", "findFromPredicate", "(", "Intersection", "i", ",", "Board", "b", ",", "Predicate", "<", "Intersection", ">", "predicate", ")", "{", "Stack", "<", "Intersection", ">", "aTraiter", "=", "new", "Stack", "<", "Intersection", ">", "(", ")", ";", "List", "<", "Intersection", ">", "traite", "=", "new", "ArrayList", "<", "Intersection", ">", "(", ")", ";", "List", "<", "Intersection", ">", "resultat", "=", "new", "ArrayList", "<", "Intersection", ">", "(", ")", ";", "aTraiter", ".", "push", "(", "i", ")", ";", "while", "(", "!", "aTraiter", ".", "isEmpty", "(", ")", ")", "{", "Intersection", "intersection", "=", "aTraiter", ".", "pop", "(", ")", ";", "if", "(", "!", "traite", ".", "contains", "(", "intersection", ")", ")", "{", "traite", ".", "add", "(", "intersection", ")", ";", "Optional", "<", "Color", ">", "c", "=", "intersection", ".", "getOccupation", "(", ")", ";", "if", "(", "predicate", ".", "test", "(", "intersection", ")", ")", "{", "aTraiter", ".", "addAll", "(", "intersection", ".", "getNeighbors", "(", "b", ")", ")", ";", "resultat", ".", "add", "(", "intersection", ")", ";", "}", "}", "}", "return", "resultat", ";", "}" ]
[ 14, 4 ]
[ 33, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
ApplicationExecutor.
null
=== Méthodes triviales ou autogénérées ===
=== Méthodes triviales ou autogénérées ===
public ListeningExecutorService getExecutor() { return service; }
[ "public", "ListeningExecutorService", "getExecutor", "(", ")", "{", "return", "service", ";", "}" ]
[ 77, 4 ]
[ 79, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
OffreServiceController.
null
obtenir offre par email
obtenir offre par email
@RequestMapping(path ="/test/{user_email}", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE) public Set<Offre> getOffEmail(@PathVariable("user_email") String email) { return service.getOffreByEmail(email); }
[ "@", "RequestMapping", "(", "path", "=", "\"/test/{user_email}\"", ",", "method", "=", "RequestMethod", ".", "GET", ",", "produces", "=", "MediaType", ".", "APPLICATION_JSON_VALUE", ")", "public", "Set", "<", "Offre", ">", "getOffEmail", "(", "@", "PathVariable", "(", "\"user_email\"", ")", "String", "email", ")", "{", "return", "service", ".", "getOffreByEmail", "(", "email", ")", ";", "}" ]
[ 134, 4 ]
[ 138, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
fragmentDivtecInfBulletin.
null
Initialise les textView langue et comm
Initialise les textView langue et comm
private void initTxtViewLangueEtComm(View view) { moy_sem1_langueEtComm = view.findViewById(R.id.divtec_inf_txtvi_langueEtComm_sem1); moy_sem2_langueEtComm = view.findViewById(R.id.divtec_inf_txtvi_langueEtComm_sem2); moy_sem3_langueEtComm = view.findViewById(R.id.divtec_inf_txtvi_langueEtComm_sem3); moy_sem4_langueEtComm = view.findViewById(R.id.divtec_inf_txtvi_langueEtComm_sem4); moy_sem5_langueEtComm = view.findViewById(R.id.divtec_inf_txtvi_langueEtComm_sem5); moy_sem6_langueEtComm = view.findViewById(R.id.divtec_inf_txtvi_langueEtComm_sem6); moy_sem7_langueEtComm = view.findViewById(R.id.divtec_inf_txtvi_langueEtComm_sem7); moy_sem8_langueEtComm = view.findViewById(R.id.divtec_inf_txtvi_langueEtComm_sem8); moy_langueEtComm_finale = view.findViewById(R.id.divtec_inf_txtvi_langueEtComm_finale); }
[ "private", "void", "initTxtViewLangueEtComm", "(", "View", "view", ")", "{", "moy_sem1_langueEtComm", "=", "view", ".", "findViewById", "(", "R", ".", "id", ".", "divtec_inf_txtvi_langueEtComm_sem1", ")", ";", "moy_sem2_langueEtComm", "=", "view", ".", "findViewById", "(", "R", ".", "id", ".", "divtec_inf_txtvi_langueEtComm_sem2", ")", ";", "moy_sem3_langueEtComm", "=", "view", ".", "findViewById", "(", "R", ".", "id", ".", "divtec_inf_txtvi_langueEtComm_sem3", ")", ";", "moy_sem4_langueEtComm", "=", "view", ".", "findViewById", "(", "R", ".", "id", ".", "divtec_inf_txtvi_langueEtComm_sem4", ")", ";", "moy_sem5_langueEtComm", "=", "view", ".", "findViewById", "(", "R", ".", "id", ".", "divtec_inf_txtvi_langueEtComm_sem5", ")", ";", "moy_sem6_langueEtComm", "=", "view", ".", "findViewById", "(", "R", ".", "id", ".", "divtec_inf_txtvi_langueEtComm_sem6", ")", ";", "moy_sem7_langueEtComm", "=", "view", ".", "findViewById", "(", "R", ".", "id", ".", "divtec_inf_txtvi_langueEtComm_sem7", ")", ";", "moy_sem8_langueEtComm", "=", "view", ".", "findViewById", "(", "R", ".", "id", ".", "divtec_inf_txtvi_langueEtComm_sem8", ")", ";", "moy_langueEtComm_finale", "=", "view", ".", "findViewById", "(", "R", ".", "id", ".", "divtec_inf_txtvi_langueEtComm_finale", ")", ";", "}" ]
[ 380, 4 ]
[ 390, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
AnnuData.
null
TODO: supprimer et modifier toutes les JSP.
TODO: supprimer et modifier toutes les JSP.
public Map<String, String> getPays() { return Collections.singletonMap("pays_nom", getAnnuCountry()); }
[ "public", "Map", "<", "String", ",", "String", ">", "getPays", "(", ")", "{", "return", "Collections", ".", "singletonMap", "(", "\"pays_nom\"", ",", "getAnnuCountry", "(", ")", ")", ";", "}" ]
[ 253, 1 ]
[ 255, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
Pioche.
null
3) si la liste est vide, on peut éventuellement la réinitialiser
3) si la liste est vide, on peut éventuellement la réinitialiser
public Integer getPif() { if(nombres.size()==0) {setTableau();} // (3) int i=pif(0,nombres.size()-1); // (1) int retour=nombres.get(i); nombres.remove(i); // (2) return retour; }
[ "public", "Integer", "getPif", "(", ")", "{", "if", "(", "nombres", ".", "size", "(", ")", "==", "0", ")", "{", "setTableau", "(", ")", ";", "}", "// (3)", "int", "i", "=", "pif", "(", "0", ",", "nombres", ".", "size", "(", ")", "-", "1", ")", ";", "// (1)", "int", "retour", "=", "nombres", ".", "get", "(", "i", ")", ";", "nombres", ".", "remove", "(", "i", ")", ";", "// (2)", "return", "retour", ";", "}" ]
[ 36, 1 ]
[ 43, 6 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
RemoteCall.
null
pourrait être utilisée dans scripts Jenkins par exemple
pourrait être utilisée dans scripts Jenkins par exemple
List<Serializable> executeActionAndCollectData(Action action, String counterName, String sessionId, String threadId, String jobId, String cacheId) throws IOException { assert action != null; final URL actionUrl = getActionUrl(action, counterName, sessionId, threadId, jobId, cacheId); return collectForUrl(actionUrl); }
[ "List", "<", "Serializable", ">", "executeActionAndCollectData", "(", "Action", "action", ",", "String", "counterName", ",", "String", "sessionId", ",", "String", "threadId", ",", "String", "jobId", ",", "String", "cacheId", ")", "throws", "IOException", "{", "assert", "action", "!=", "null", ";", "final", "URL", "actionUrl", "=", "getActionUrl", "(", "action", ",", "counterName", ",", "sessionId", ",", "threadId", ",", "jobId", ",", "cacheId", ")", ";", "return", "collectForUrl", "(", "actionUrl", ")", ";", "}" ]
[ 97, 1 ]
[ 103, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
Algo3a.
null
Algo 3c Afficher de n à m (de manière décroissante).
Algo 3c Afficher de n à m (de manière décroissante).
public static void main (String [] args) { int []tab = {5, 9, 4,7,8}; int j, max; int i = 0; int cpt = 5; for (i=0; i< tab.length; i++)
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "int", "[", "]", "tab", "=", "{", "5", ",", "9", ",", "4", ",", "7", ",", "8", "}", ";", "int", "j", ",", "max", ";", "int", "i", "=", "0", ";", "int", "cpt", "=", "5", ";", "for", "(", "i", "=", "0", ";", "i", "<", "tab", ".", "length", ";", "i", "++", ")", "", "" ]
[ 6, 4 ]
[ 13, 37 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
EntryPoint.
null
utilisé par la JSP sendJabberCommand
utilisé par la JSP sendJabberCommand
public static String sendJabberCommand(HttpServletRequest request) { String theResult; try { theResult = EntryPoint.doSendJabberCommand(request); } catch (final Throwable aThrowable) { EntryPoint.LOGGER.fatal(aThrowable, aThrowable); theResult = aThrowable.getMessage(); } return theResult; }
[ "public", "static", "String", "sendJabberCommand", "(", "HttpServletRequest", "request", ")", "{", "String", "theResult", ";", "try", "{", "theResult", "=", "EntryPoint", ".", "doSendJabberCommand", "(", "request", ")", ";", "}", "catch", "(", "final", "Throwable", "aThrowable", ")", "{", "EntryPoint", ".", "LOGGER", ".", "fatal", "(", "aThrowable", ",", "aThrowable", ")", ";", "theResult", "=", "aThrowable", ".", "getMessage", "(", ")", ";", "}", "return", "theResult", ";", "}" ]
[ 188, 1 ]
[ 198, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
MonitoringController.
null
jmxValue=x|y|z pourra aussi être utilisé par munin notamment
jmxValue=x|y|z pourra aussi être utilisé par munin notamment
private void doJmxValue(HttpServletResponse httpResponse, String jmxValueParameter) throws IOException { httpResponse.setContentType("text/plain"); httpResponse.getWriter().write(MBeans.getConvertedAttributes(jmxValueParameter)); httpResponse.flushBuffer(); }
[ "private", "void", "doJmxValue", "(", "HttpServletResponse", "httpResponse", ",", "String", "jmxValueParameter", ")", "throws", "IOException", "{", "httpResponse", ".", "setContentType", "(", "\"text/plain\"", ")", ";", "httpResponse", ".", "getWriter", "(", ")", ".", "write", "(", "MBeans", ".", "getConvertedAttributes", "(", "jmxValueParameter", ")", ")", ";", "httpResponse", ".", "flushBuffer", "(", ")", ";", "}" ]
[ 446, 1 ]
[ 451, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
NoteSQLiteOpenHelper.
null
Insere une note dans la BD
Insere une note dans la BD
public void addNote(Note note) { ContentValues cv = new ContentValues(); cv.put(noteTable.COLUMN_NAME, note.getNote()); cv.put(noteTable.COLUMN_VALUE, note.getValue()); cv.put(noteTable.COLUMN_CATEGORY, note.getCategory()); db.insert(noteTable.TABLE_NAME, null, cv); }
[ "public", "void", "addNote", "(", "Note", "note", ")", "{", "ContentValues", "cv", "=", "new", "ContentValues", "(", ")", ";", "cv", ".", "put", "(", "noteTable", ".", "COLUMN_NAME", ",", "note", ".", "getNote", "(", ")", ")", ";", "cv", ".", "put", "(", "noteTable", ".", "COLUMN_VALUE", ",", "note", ".", "getValue", "(", ")", ")", ";", "cv", ".", "put", "(", "noteTable", ".", "COLUMN_CATEGORY", ",", "note", ".", "getCategory", "(", ")", ")", ";", "db", ".", "insert", "(", "noteTable", ".", "TABLE_NAME", ",", "null", ",", "cv", ")", ";", "}" ]
[ 341, 4 ]
[ 347, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
MonitoringFilter.
null
cette méthode est protected pour pouvoir être surchargée dans une classe définie par l'application
cette méthode est protected pour pouvoir être surchargée dans une classe définie par l'application
protected boolean isAllowed(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException { return httpAuth.isAllowed(httpRequest, httpResponse); }
[ "protected", "boolean", "isAllowed", "(", "HttpServletRequest", "httpRequest", ",", "HttpServletResponse", "httpResponse", ")", "throws", "IOException", "{", "return", "httpAuth", ".", "isAllowed", "(", "httpRequest", ",", "httpResponse", ")", ";", "}" ]
[ 492, 1 ]
[ 495, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
RestEleve.
null
-------------------Effacer un élève d'un id donné--------------------------------------------------------
-------------------Effacer un élève d'un id donné--------------------------------------------------------
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE) public ResponseEntity<Void> deleteEleve(@PathVariable(value = "id") int id) throws Exception{ System.out.println("effacement de l'élève d'id " + id); EleveEntity eleve = mde.read(id); mde.del(eleve); return new ResponseEntity<>(HttpStatus.OK); }
[ "@", "RequestMapping", "(", "value", "=", "\"/{id}\"", ",", "method", "=", "RequestMethod", ".", "DELETE", ")", "public", "ResponseEntity", "<", "Void", ">", "deleteEleve", "(", "@", "PathVariable", "(", "value", "=", "\"id\"", ")", "int", "id", ")", "throws", "Exception", "{", "System", ".", "out", ".", "println", "(", "\"effacement de l'élève d'id \" +", "i", ");", "", "", "EleveEntity", "eleve", "=", "mde", ".", "read", "(", "id", ")", ";", "mde", ".", "del", "(", "eleve", ")", ";", "return", "new", "ResponseEntity", "<>", "(", "HttpStatus", ".", "OK", ")", ";", "}" ]
[ 69, 4 ]
[ 75, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
Mailer.
null
pour tests unitaires
pour tests unitaires
void setSession(Session session) { this.session = session; fromAddress = InternetAddress.getLocalAddress(session); }
[ "void", "setSession", "(", "Session", "session", ")", "{", "this", ".", "session", "=", "session", ";", "fromAddress", "=", "InternetAddress", ".", "getLocalAddress", "(", "session", ")", ";", "}" ]
[ 104, 1 ]
[ 107, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
Givemehandcontroller.
null
Récupérer la liste des produits
Récupérer la liste des produits
@RequestMapping(value = "/Hand", method = RequestMethod.GET) public String listeProduits() { return "Hello We are Give ME hand"; }
[ "@", "RequestMapping", "(", "value", "=", "\"/Hand\"", ",", "method", "=", "RequestMethod", ".", "GET", ")", "public", "String", "listeProduits", "(", ")", "{", "return", "\"Hello We are Give ME hand\"", ";", "}" ]
[ 11, 4 ]
[ 15, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
CacheInformations.
null
efficacité en pourcentage du cache (mémoire + disque) par rapport au total des accès
efficacité en pourcentage du cache (mémoire + disque) par rapport au total des accès
public int getHitsRatio() { final long accessCount = cacheHits + cacheMisses; if (accessCount == 0) { return -1; } return (int) (100 * cacheHits / accessCount); }
[ "public", "int", "getHitsRatio", "(", ")", "{", "final", "long", "accessCount", "=", "cacheHits", "+", "cacheMisses", ";", "if", "(", "accessCount", "==", "0", ")", "{", "return", "-", "1", ";", "}", "return", "(", "int", ")", "(", "100", "*", "cacheHits", "/", "accessCount", ")", ";", "}" ]
[ 335, 1 ]
[ 341, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
MainActivity.
null
Selection des outils
Selection des outils
public void selectionnerCourbe(View vue){ ecouteur.setOutil(1); buttonLine.setBackgroundColor(0xFFA3A3A3); buttonCurve.setBackgroundColor(0xFF616161); buttonRectangle.setBackgroundColor(0xFFA3A3A3); }
[ "public", "void", "selectionnerCourbe", "(", "View", "vue", ")", "{", "ecouteur", ".", "setOutil", "(", "1", ")", ";", "buttonLine", ".", "setBackgroundColor", "(", "0xFFA3A3A3", ")", ";", "buttonCurve", ".", "setBackgroundColor", "(", "0xFF616161", ")", ";", "buttonRectangle", ".", "setBackgroundColor", "(", "0xFFA3A3A3", ")", ";", "}" ]
[ 49, 4 ]
[ 54, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
CleanXml.
null
Enlève le XML indésirable qui se rajoute tout seul pour éviter que jinjava ne génère une exception
Enlève le XML indésirable qui se rajoute tout seul pour éviter que jinjava ne génère une exception
static void corrigerXML(){ System.out.println(); System.out.println("Vérification du template..."); List<String> listeChampsARemplacer = new ArrayList<>(); List<String> listeChampsPropres = new ArrayList<>(); List<String> listeRegex = new ArrayList<>(); // Pour supprimer les balises xml String regexChampSimple = "({(?:[^{}]*?{[^{}]*?}[^{}]*?})).*?"; String regexIfElseFor = "({(?:[^{}%]*?%[^{}%]*?%[^{}]*?})).*?"; listeRegex.add(regexChampSimple); listeRegex.add(regexIfElseFor); for (String regex: listeRegex){ listeChampsARemplacer = retournerListeMatchs(escapeMetaCharacters(regex), contenuDuXml); listeChampsARemplacer = enleverDoublonListe(listeChampsARemplacer); listeChampsARemplacer = enleverChampsSains(listeChampsARemplacer); listeChampsPropres = cleanBalisesIndesirables(listeChampsARemplacer); reinjecterChampsPropres(listeChampsARemplacer, listeChampsPropres); } listeChampsARemplacer.clear(); listeChampsPropres.clear(); listeRegex.clear(); System.out.println("Template vérifié ou corrigé."); }
[ "static", "void", "corrigerXML", "(", ")", "{", "System", ".", "out", ".", "println", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"Vérification du template...\")", ";", "", "List", "<", "String", ">", "listeChampsARemplacer", "=", "new", "ArrayList", "<>", "(", ")", ";", "List", "<", "String", ">", "listeChampsPropres", "=", "new", "ArrayList", "<>", "(", ")", ";", "List", "<", "String", ">", "listeRegex", "=", "new", "ArrayList", "<>", "(", ")", ";", "// Pour supprimer les balises xml", "String", "regexChampSimple", "=", "\"({(?:[^{}]*?{[^{}]*?}[^{}]*?})).*?\"", ";", "String", "regexIfElseFor", "=", "\"({(?:[^{}%]*?%[^{}%]*?%[^{}]*?})).*?\"", ";", "listeRegex", ".", "add", "(", "regexChampSimple", ")", ";", "listeRegex", ".", "add", "(", "regexIfElseFor", ")", ";", "for", "(", "String", "regex", ":", "listeRegex", ")", "{", "listeChampsARemplacer", "=", "retournerListeMatchs", "(", "escapeMetaCharacters", "(", "regex", ")", ",", "contenuDuXml", ")", ";", "listeChampsARemplacer", "=", "enleverDoublonListe", "(", "listeChampsARemplacer", ")", ";", "listeChampsARemplacer", "=", "enleverChampsSains", "(", "listeChampsARemplacer", ")", ";", "listeChampsPropres", "=", "cleanBalisesIndesirables", "(", "listeChampsARemplacer", ")", ";", "reinjecterChampsPropres", "(", "listeChampsARemplacer", ",", "listeChampsPropres", ")", ";", "}", "listeChampsARemplacer", ".", "clear", "(", ")", ";", "listeChampsPropres", ".", "clear", "(", ")", ";", "listeRegex", ".", "clear", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"Template vérifié ou corrigé.\");", "", "", "}" ]
[ 190, 4 ]
[ 215, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
CleanXml.
null
Récupère le contenu de document.xml dans une String
Récupère le contenu de document.xml dans une String
private static String readFile(String file) throws IOException { BufferedReader reader = new BufferedReader(new FileReader(file)); String line = null; StringBuilder stringBuilder = new StringBuilder(); String ls = System.getProperty("line.separator"); try { while((line = reader.readLine()) != null) { stringBuilder.append(line); //stringBuilder.append(ls); } return stringBuilder.toString(); } finally { reader.close(); //System.out.println("stringbuilder closed"); } }
[ "private", "static", "String", "readFile", "(", "String", "file", ")", "throws", "IOException", "{", "BufferedReader", "reader", "=", "new", "BufferedReader", "(", "new", "FileReader", "(", "file", ")", ")", ";", "String", "line", "=", "null", ";", "StringBuilder", "stringBuilder", "=", "new", "StringBuilder", "(", ")", ";", "String", "ls", "=", "System", ".", "getProperty", "(", "\"line.separator\"", ")", ";", "try", "{", "while", "(", "(", "line", "=", "reader", ".", "readLine", "(", ")", ")", "!=", "null", ")", "{", "stringBuilder", ".", "append", "(", "line", ")", ";", "//stringBuilder.append(ls);", "}", "return", "stringBuilder", ".", "toString", "(", ")", ";", "}", "finally", "{", "reader", ".", "close", "(", ")", ";", "//System.out.println(\"stringbuilder closed\");", "}", "}" ]
[ 42, 4 ]
[ 58, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
RestClasse.
null
-------------------Retrouver la classe correspondant à un id donné--------------------------------------------------------
-------------------Retrouver la classe correspondant à un id donné--------------------------------------------------------
@RequestMapping(value = "/{id}", method = RequestMethod.GET) public ResponseEntity<ClasseEntity> getClasse(@PathVariable(value = "id") String id) throws Exception{ System.out.println("recherche de la classe d' id " + id); int identifiant = Integer.parseInt(id); ClasseEntity classe = mdcl.read(identifiant); return new ResponseEntity<>(classe, HttpStatus.OK); }
[ "@", "RequestMapping", "(", "value", "=", "\"/{id}\"", ",", "method", "=", "RequestMethod", ".", "GET", ")", "public", "ResponseEntity", "<", "ClasseEntity", ">", "getClasse", "(", "@", "PathVariable", "(", "value", "=", "\"id\"", ")", "String", "id", ")", "throws", "Exception", "{", "System", ".", "out", ".", "println", "(", "\"recherche de la classe d' id \"", "+", "id", ")", ";", "int", "identifiant", "=", "Integer", ".", "parseInt", "(", "id", ")", ";", "ClasseEntity", "classe", "=", "mdcl", ".", "read", "(", "identifiant", ")", ";", "return", "new", "ResponseEntity", "<>", "(", "classe", ",", "HttpStatus", ".", "OK", ")", ";", "}" ]
[ 35, 4 ]
[ 41, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
I18N.
null
méthodes utilitaires de formatage de dates et de nombres
méthodes utilitaires de formatage de dates et de nombres
public static DecimalFormat createIntegerFormat() { // attention ces instances de DecimalFormat ne doivent pas être statiques // car DecimalFormat n'est pas multi-thread-safe, return new DecimalFormat("#,##0", getDecimalFormatSymbols()); }
[ "public", "static", "DecimalFormat", "createIntegerFormat", "(", ")", "{", "// attention ces instances de DecimalFormat ne doivent pas être statiques\r", "// car DecimalFormat n'est pas multi-thread-safe,\r", "return", "new", "DecimalFormat", "(", "\"#,##0\"", ",", "getDecimalFormatSymbols", "(", ")", ")", ";", "}" ]
[ 204, 1 ]
[ 208, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
CleanXml.
null
Enlève les champs qui ne posent pas de problème
Enlève les champs qui ne posent pas de problème
private static List<String> enleverChampsSains(List<String> listeMatchs){ List<String> listeProbleme = new ArrayList<>(); for (String match: listeMatchs){ if (match.indexOf("<") != -1) listeProbleme.add(match); } return listeProbleme; }
[ "private", "static", "List", "<", "String", ">", "enleverChampsSains", "(", "List", "<", "String", ">", "listeMatchs", ")", "{", "List", "<", "String", ">", "listeProbleme", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "String", "match", ":", "listeMatchs", ")", "{", "if", "(", "match", ".", "indexOf", "(", "\"<\"", ")", "!=", "-", "1", ")", "listeProbleme", ".", "add", "(", "match", ")", ";", "}", "return", "listeProbleme", ";", "}" ]
[ 126, 4 ]
[ 132, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
TomcatInformations.
null
visibilité package pour réinitialisation en test unitaire
visibilité package pour réinitialisation en test unitaire
public static void initMBeans() { // rq: en général, il y a 2 connecteurs (http et ajp 1.3) définis dans server.xml et donc // 2 threadPools et 2 globalRequestProcessors de même nom : http-8080 et jk-8009 (ajp13) THREAD_POOLS.clear(); GLOBAL_REQUEST_PROCESSORS.clear(); THREAD_POOLS.addAll(MBeansAccessor.getTomcatThreadPools()); GLOBAL_REQUEST_PROCESSORS.addAll(MBeansAccessor.getTomcatGlobalRequestProcessors()); }
[ "public", "static", "void", "initMBeans", "(", ")", "{", "// rq: en général, il y a 2 connecteurs (http et ajp 1.3) définis dans server.xml et donc\r", "// 2 threadPools et 2 globalRequestProcessors de même nom : http-8080 et jk-8009 (ajp13)\r", "THREAD_POOLS", ".", "clear", "(", ")", ";", "GLOBAL_REQUEST_PROCESSORS", ".", "clear", "(", ")", ";", "THREAD_POOLS", ".", "addAll", "(", "MBeansAccessor", ".", "getTomcatThreadPools", "(", ")", ")", ";", "GLOBAL_REQUEST_PROCESSORS", ".", "addAll", "(", "MBeansAccessor", ".", "getTomcatGlobalRequestProcessors", "(", ")", ")", ";", "}" ]
[ 134, 1 ]
[ 141, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
UserPrefsServices.
null
rajouter ici le nouveau champ
rajouter ici le nouveau champ
public static final List getChampUserPrefs() { final List<String> champUserPrefs = new ArrayList<String>(); champUserPrefs.add(UserPrefs.USER_PREFS_LAYOUT); return champUserPrefs; }
[ "public", "static", "final", "List", "getChampUserPrefs", "(", ")", "{", "final", "List", "<", "String", ">", "champUserPrefs", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "champUserPrefs", ".", "add", "(", "UserPrefs", ".", "USER_PREFS_LAYOUT", ")", ";", "return", "champUserPrefs", ";", "}" ]
[ 27, 1 ]
[ 31, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
ConfidenceEvaluator.
null
d'au moins 1 octove (X*2 hertz) entre min et max
d'au moins 1 octove (X*2 hertz) entre min et max
public void compute(List<SoundEvent> pitch, double timeWindow) { // si suffisament de // pour chaque event : reconstruire les X premières secondes for (int i = 0; i < pitch.size(); i++) { int winStop = i; int winStart = getPreviousWindowStart(pitch, i, timeWindow); if(hasMoreThanOctaveRangeForWindow(pitch, winStart, winStop)){ pitch.get(i).confidence = 0; } } }
[ "public", "void", "compute", "(", "List", "<", "SoundEvent", ">", "pitch", ",", "double", "timeWindow", ")", "{", "// si suffisament de", "// pour chaque event : reconstruire les X premières secondes", "for", "(", "int", "i", "=", "0", ";", "i", "<", "pitch", ".", "size", "(", ")", ";", "i", "++", ")", "{", "int", "winStop", "=", "i", ";", "int", "winStart", "=", "getPreviousWindowStart", "(", "pitch", ",", "i", ",", "timeWindow", ")", ";", "if", "(", "hasMoreThanOctaveRangeForWindow", "(", "pitch", ",", "winStart", ",", "winStop", ")", ")", "{", "pitch", ".", "get", "(", "i", ")", ".", "confidence", "=", "0", ";", "}", "}", "}" ]
[ 10, 4 ]
[ 21, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
NoteSQLiteOpenHelper.
null
/*Remplit la table (de la BD) qui contiendra les questions avec des questions par défaut
/*Remplit la table (de la BD) qui contiendra les questions avec des questions par défaut
private void fillNoteTable(SQLiteDatabase db) { Note initial = new Note("INIT_BD", 0.5, null); addNote(initial, db); //region implements Base Note mod_math = new Note("Math", 0.5, "EPT"); addNote(mod_math, db); Note mod_atelier = new Note("Atelier", 0.5, "EPT"); addNote(mod_atelier, db); Note mod_anglais = new Note("Anglais", 0.5, "EPT"); addNote(mod_anglais, db); Note mod_economie = new Note("Economie", 0.5, "EPT"); addNote(mod_economie, db); Note mod_eduphys = new Note("Education Physique", 0.5, "EPT"); addNote(mod_eduphys, db); Note mod_science = new Note("Science", 0.5, "EPT"); addNote(mod_science, db); Note semestre1 = new Note("Premier semestre", 0.5, "EPT"); addNote(semestre1, db); Note semestre2 = new Note("Deuxième semestre", 0.5, "EPT"); addNote(semestre2, db); //endregion //region implements COMPOSANT Note divtec_inf_rbgp_value = new Note("divtec_inf_rbgp_value", 1.0, "COMPOSANT"); addNote(divtec_inf_rbgp_value, db); //endregion //region implements MOYENNES Note divtec_inf_moy_tot_cg = new Note("divtec_inf_moy_tot_cg", 0.5, null); addNote(divtec_inf_moy_tot_cg, db); Note divtec_inf_moy_tot_atelier = new Note("divtec_inf_moy_tot_atelier", 0.5, null); addNote(divtec_inf_moy_tot_atelier, db); Note divtec_inf_moy_tot_ept = new Note("divtec_inf_moy_tot_ept", 0.5, null); addNote(divtec_inf_moy_tot_ept, db); Note divtec_inf_moy_tot_mod = new Note("divtec_inf_moy_tot_mod", 0.5, null); addNote(divtec_inf_moy_tot_mod, db); Note divtec_inf_moy_tot_mod_interEntreprise = new Note("divtec_inf_moy_tot_mod_interEntreprise", 0.5, null); addNote(divtec_inf_moy_tot_mod_interEntreprise, db); Note divtec_inf_moy_tot_mod_standard = new Note("divtec_inf_moy_tot_mod_standard", 0.5, null); addNote(divtec_inf_moy_tot_mod_standard, db); Note divtec_inf_moy_tot_tot = new Note("divtec_inf_moy_tot_tot", 0.5, null); addNote(divtec_inf_moy_tot_tot, db); //endregion // region implements MODULES Note divtec_inf_math_mi = new Note("MI", 0.5, "MOD"); addNote(divtec_inf_math_mi, db); Note mod_100 = new Note("M100", 0.5, "MOD"); addNote(mod_100, db); Note mod_101 = new Note("M101", 0.5, "MOD"); addNote(mod_101, db); Note mod_104 = new Note("M104", 0.5, "MOD"); addNote(mod_104, db); Note mod_105 = new Note("M105", 0.5, "MOD"); addNote(mod_105, db); Note mod_114 = new Note("M114", 0.5, "MOD"); addNote(mod_114, db); Note mod_115 = new Note("M115", 0.5, "MOD"); addNote(mod_115, db); Note mod_117 = new Note("M117", 0.5, "MOD"); addNote(mod_117, db); Note mod_122 = new Note("M122", 0.5, "MOD"); addNote(mod_122, db); Note mod_123 = new Note("M123", 0.5, "MOD"); addNote(mod_123, db); Note mod_124 = new Note("M124", 0.5, "MOD"); addNote(mod_124, db); Note mod_127 = new Note("M127", 0.5, "MOD"); addNote(mod_127, db); Note mod_129 = new Note("M129", 0.5, "MOD"); addNote(mod_129, db); Note mod_133 = new Note("M133", 0.5, "MOD"); addNote(mod_133, db); Note mod_140 = new Note("M140", 0.5, "MOD"); addNote(mod_140, db); Note mod_143 = new Note("M143", 0.5, "MOD"); addNote(mod_143, db); Note mod_145 = new Note("M145", 0.5, "MOD"); addNote(mod_145, db); Note mod_151 = new Note("M151", 0.5, "MOD"); addNote(mod_151, db); Note mod_153 = new Note("M153", 0.5, "MOD"); addNote(mod_153, db); Note mod_159 = new Note("M159", 0.5, "MOD"); addNote(mod_159, db); Note mod_182 = new Note("M182", 0.5, "MOD"); addNote(mod_182, db); Note mod_214 = new Note("M214", 0.5, "MOD"); addNote(mod_214, db); Note mod_226 = new Note("M226", 0.5, "MOD"); addNote(mod_226, db); Note mod_302 = new Note("M302", 0.5, "MOD"); addNote(mod_302, db); Note mod_304 = new Note("M304", 0.5, "MOD"); addNote(mod_304, db); Note mod_305 = new Note("M305", 0.5, "MOD"); addNote(mod_305, db); Note mod_306 = new Note("M306", 0.5, "MOD"); addNote(mod_306, db); Note mod_340 = new Note("M340", 0.5, "MOD"); addNote(mod_340, db); Note mod_403 = new Note("M403", 0.5, "MOD"); addNote(mod_403, db); Note mod_404 = new Note("M404", 0.5, "MOD"); addNote(mod_404, db); Note mod_431 = new Note("M431", 0.5, "MOD"); addNote(mod_431, db); Note mod_437 = new Note("M437", 0.5, "MOD"); addNote(mod_437, db); //endregion // region implements MATH //MATH Note divtec_inf_math_sem1 = new Note("divtec_inf_math_sem1", 0.5, "EPT"); addNote(divtec_inf_math_sem1, db); Note divtec_inf_math_sem2 = new Note("divtec_inf_math_sem2", 0.5, "EPT"); addNote(divtec_inf_math_sem2, db); Note divtec_inf_math_sem3 = new Note("divtec_inf_math_sem3", 0.5, "EPT"); addNote(divtec_inf_math_sem3, db); Note divtec_inf_math_sem4 = new Note("divtec_inf_math_sem4", 0.5, "EPT"); addNote(divtec_inf_math_sem4, db); Note divtec_inf_math_sem5 = new Note("divtec_inf_math_sem5", 0.5, "EPT"); addNote(divtec_inf_math_sem5, db); Note divtec_inf_math_sem6 = new Note("divtec_inf_math_sem6", 0.5, "EPT"); addNote(divtec_inf_math_sem6, db); Note divtec_inf_math_sem7 = new Note("divtec_inf_math_sem7", 0.5, "EPT"); addNote(divtec_inf_math_sem7, db); Note divtec_inf_math_sem8 = new Note("divtec_inf_math_sem8", 0.5, "EPT"); addNote(divtec_inf_math_sem8, db); Note divtec_inf_math_finale = new Note("divtec_inf_math_finale", 0.5, "EPT"); addNote(divtec_inf_math_finale, db); // endregion implements // region implements SCIENCE Note divtec_inf_science_sem1 = new Note("divtec_inf_science_sem1", 0.5, "EPT"); addNote(divtec_inf_science_sem1, db); Note divtec_inf_science_sem2 = new Note("divtec_inf_science_sem2", 0.5, "EPT"); addNote(divtec_inf_science_sem2, db); Note divtec_inf_science_sem3 = new Note("divtec_inf_science_sem3", 0.5, "EPT"); addNote(divtec_inf_science_sem3, db); Note divtec_inf_science_sem4 = new Note("divtec_inf_science_sem4", 0.5, "EPT"); addNote(divtec_inf_science_sem4, db); Note divtec_inf_science_sem5 = new Note("divtec_inf_science_sem5", 0.5, "EPT"); addNote(divtec_inf_science_sem5, db); Note divtec_inf_science_sem6 = new Note("divtec_inf_science_sem6", 0.5, "EPT"); addNote(divtec_inf_science_sem6, db); Note divtec_inf_science_sem7 = new Note("divtec_inf_science_sem7", 0.5, "EPT"); addNote(divtec_inf_science_sem7, db); Note divtec_inf_science_sem8 = new Note("divtec_inf_science_sem8", 0.5, "EPT"); addNote(divtec_inf_science_sem8, db); Note divtec_inf_science_finale = new Note("divtec_inf_science_finale", 0.5, "EPT"); addNote(divtec_inf_science_finale, db); // endregion implements // region implements ANGLAIS Note divtec_inf_anglais_sem1 = new Note("divtec_inf_anglais_sem1", 0.5, "EPT"); addNote(divtec_inf_anglais_sem1, db); Note divtec_inf_anglais_sem2 = new Note("divtec_inf_anglais_sem2", 0.5, "EPT"); addNote(divtec_inf_anglais_sem2, db); Note divtec_inf_anglais_sem3 = new Note("divtec_inf_anglais_sem3", 0.5, "EPT"); addNote(divtec_inf_anglais_sem3, db); Note divtec_inf_anglais_sem4 = new Note("divtec_inf_anglais_sem4", 0.5, "EPT"); addNote(divtec_inf_anglais_sem4, db); Note divtec_inf_anglais_sem5 = new Note("divtec_inf_anglais_sem5", 0.5, "EPT"); addNote(divtec_inf_anglais_sem5, db); Note divtec_inf_anglais_sem6 = new Note("divtec_inf_anglais_sem6", 0.5, "EPT"); addNote(divtec_inf_anglais_sem6, db); Note divtec_inf_anglais_sem7 = new Note("divtec_inf_anglais_sem7", 0.5, "EPT"); addNote(divtec_inf_anglais_sem7, db); Note divtec_inf_anglais_sem8 = new Note("divtec_inf_anglais_sem8", 0.5, "EPT"); addNote(divtec_inf_anglais_sem8, db); Note divtec_inf_anglais_finale = new Note("divtec_inf_anglais_finale", 0.5, "EPT"); addNote(divtec_inf_anglais_finale, db); // endregion implements // region implements ECONOMIE Note divtec_inf_economie_sem1 = new Note("divtec_inf_economie_sem1", 0.5, "EPT"); addNote(divtec_inf_economie_sem1, db); Note divtec_inf_economie_sem2 = new Note("divtec_inf_economie_sem2", 0.5, "EPT"); addNote(divtec_inf_economie_sem2, db); Note divtec_inf_economie_sem3 = new Note("divtec_inf_economie_sem3", 0.5, "EPT"); addNote(divtec_inf_economie_sem3, db); Note divtec_inf_economie_sem4 = new Note("divtec_inf_economie_sem4", 0.5, "EPT"); addNote(divtec_inf_economie_sem4, db); Note divtec_inf_economie_sem5 = new Note("divtec_inf_economie_sem5", 0.5, "EPT"); addNote(divtec_inf_economie_sem5, db); Note divtec_inf_economie_sem6 = new Note("divtec_inf_economie_sem6", 0.5, "EPT"); addNote(divtec_inf_economie_sem6, db); Note divtec_inf_economie_sem7 = new Note("divtec_inf_economie_sem7", 0.5, "EPT"); addNote(divtec_inf_economie_sem7, db); Note divtec_inf_economie_sem8 = new Note("divtec_inf_economie_sem8", 0.5, "EPT"); addNote(divtec_inf_economie_sem8, db); Note divtec_inf_economie_finale = new Note("divtec_inf_economie_finale", 0.5, "EPT"); addNote(divtec_inf_economie_finale, db); // endregion implements // region implements EDU PHYSIQUE Note divtec_inf_edu_physique_sem1 = new Note("divtec_inf_edu_physique_sem1", 0.5, "EPT"); addNote(divtec_inf_edu_physique_sem1, db); Note divtec_inf_edu_physique_sem2 = new Note("divtec_inf_edu_physique_sem2", 0.5, "EPT"); addNote(divtec_inf_edu_physique_sem2, db); Note divtec_inf_edu_physique_sem3 = new Note("divtec_inf_edu_physique_sem3", 0.5, "EPT"); addNote(divtec_inf_edu_physique_sem3, db); Note divtec_inf_edu_physique_sem4 = new Note("divtec_inf_edu_physique_sem4", 0.5, "EPT"); addNote(divtec_inf_edu_physique_sem4, db); Note divtec_inf_edu_physique_sem5 = new Note("divtec_inf_edu_physique_sem5", 0.5, "EPT"); addNote(divtec_inf_edu_physique_sem5, db); Note divtec_inf_edu_physique_sem6 = new Note("divtec_inf_edu_physique_sem6", 0.5, "EPT"); addNote(divtec_inf_edu_physique_sem6, db); Note divtec_inf_edu_physique_sem7 = new Note("divtec_inf_edu_physique_sem7", 0.5, "EPT"); addNote(divtec_inf_edu_physique_sem7, db); Note divtec_inf_edu_physique_sem8 = new Note("divtec_inf_edu_physique_sem8", 0.5, "EPT"); addNote(divtec_inf_edu_physique_sem8, db); Note divtec_inf_edu_physique_finale = new Note("divtec_inf_edu_physique_finale", 0.5, "EPT"); addNote(divtec_inf_edu_physique_finale, db); // endregion implements //region implements Société Note divtec_inf_societe_sem1 = new Note("divtec_inf_societe_sem1", 0.5, "EPT"); addNote(divtec_inf_societe_sem1, db); Note divtec_inf_societe_sem2 = new Note("divtec_inf_societe_sem2", 0.5, "EPT"); addNote(divtec_inf_societe_sem2, db); Note divtec_inf_societe_sem3 = new Note("divtec_inf_societe_sem3", 0.5, "EPT"); addNote(divtec_inf_societe_sem3, db); Note divtec_inf_societe_sem4 = new Note("divtec_inf_societe_sem4", 0.5, "EPT"); addNote(divtec_inf_societe_sem4, db); Note divtec_inf_societe_sem5 = new Note("divtec_inf_societe_sem5", 0.5, "EPT"); addNote(divtec_inf_societe_sem5, db); Note divtec_inf_societe_sem6 = new Note("divtec_inf_societe_sem6", 0.5, "EPT"); addNote(divtec_inf_societe_sem6, db); Note divtec_inf_societe_sem7 = new Note("divtec_inf_societe_sem7", 0.5, "EPT"); addNote(divtec_inf_societe_sem7, db); Note divtec_inf_societe_sem8 = new Note("divtec_inf_societe_sem8", 0.5, "EPT"); addNote(divtec_inf_societe_sem8, db); //endregion // region implements Langue et Comm Note divtec_inf_langueEtComm_sem1 = new Note("divtec_inf_langueEtComm_sem1", 0.5, "EPT"); addNote(divtec_inf_edu_physique_sem1, db); Note divtec_inf_langueEtComm_sem2 = new Note("divtec_inf_langueEtComm_sem2", 0.5, "EPT"); addNote(divtec_inf_edu_physique_sem1, db); Note divtec_inf_langueEtComm_sem3 = new Note("divtec_inf_langueEtComm_sem3", 0.5, "EPT"); addNote(divtec_inf_edu_physique_sem1, db); Note divtec_inf_langueEtComm_sem4 = new Note("divtec_inf_langueEtComm_sem4", 0.5, "EPT"); addNote(divtec_inf_edu_physique_sem1, db); Note divtec_inf_langueEtComm_sem5 = new Note("divtec_inf_langueEtComm_sem5", 0.5, "EPT"); addNote(divtec_inf_edu_physique_sem1, db); Note divtec_inf_langueEtComm_sem6 = new Note("divtec_inf_langueEtComm_sem6", 0.5, "EPT"); addNote(divtec_inf_edu_physique_sem1, db); Note divtec_inf_langueEtComm_sem7 = new Note("divtec_inf_langueEtComm_sem7", 0.5, "EPT"); addNote(divtec_inf_edu_physique_sem1, db); Note divtec_inf_langueEtComm_sem8 = new Note("divtec_inf_langueEtComm_sem8", 0.5, "EPT"); addNote(divtec_inf_edu_physique_sem1, db); //endregion //region implements ATELIER Note divtec_inf_atelier_sem1 = new Note("divtec_inf_atelier_sem1", 0.5, "ATE"); addNote(divtec_inf_atelier_sem1, db); Note divtec_inf_atelier_sem2 = new Note("divtec_inf_atelier_sem2", 0.5, "ATE"); addNote(divtec_inf_atelier_sem2, db); Note divtec_inf_atelier_sem3 = new Note("divtec_inf_atelier_sem3", 0.5, "ATE"); addNote(divtec_inf_atelier_sem3, db); Note divtec_inf_atelier_sem4 = new Note("divtec_inf_atelier_sem4", 0.5, "ATE"); addNote(divtec_inf_atelier_sem4, db); Note divtec_inf_atelier_sem5 = new Note("divtec_inf_atelier_sem5", 0.5, "ATE"); addNote(divtec_inf_atelier_sem5, db); Note divtec_inf_atelier_sem6 = new Note("divtec_inf_atelier_sem6", 0.5, "ATE"); addNote(divtec_inf_atelier_sem6, db); Note divtec_inf_atelier_sem7 = new Note("divtec_inf_atelier_sem7", 0.5, "ATE"); addNote(divtec_inf_atelier_sem7, db); Note divtec_inf_atelier_sem8 = new Note("divtec_inf_atelier_sem8", 0.5, "ATE"); addNote(divtec_inf_atelier_sem8, db); //endregion }
[ "private", "void", "fillNoteTable", "(", "SQLiteDatabase", "db", ")", "{", "Note", "initial", "=", "new", "Note", "(", "\"INIT_BD\"", ",", "0.5", ",", "null", ")", ";", "addNote", "(", "initial", ",", "db", ")", ";", "//region implements Base", "Note", "mod_math", "=", "new", "Note", "(", "\"Math\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "mod_math", ",", "db", ")", ";", "Note", "mod_atelier", "=", "new", "Note", "(", "\"Atelier\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "mod_atelier", ",", "db", ")", ";", "Note", "mod_anglais", "=", "new", "Note", "(", "\"Anglais\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "mod_anglais", ",", "db", ")", ";", "Note", "mod_economie", "=", "new", "Note", "(", "\"Economie\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "mod_economie", ",", "db", ")", ";", "Note", "mod_eduphys", "=", "new", "Note", "(", "\"Education Physique\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "mod_eduphys", ",", "db", ")", ";", "Note", "mod_science", "=", "new", "Note", "(", "\"Science\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "mod_science", ",", "db", ")", ";", "Note", "semestre1", "=", "new", "Note", "(", "\"Premier semestre\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "semestre1", ",", "db", ")", ";", "Note", "semestre2", "=", "new", "Note", "(", "\"Deuxième semestre\",", " ", ".5,", " ", "EPT\")", ";", "", "addNote", "(", "semestre2", ",", "db", ")", ";", "//endregion", "//region implements COMPOSANT", "Note", "divtec_inf_rbgp_value", "=", "new", "Note", "(", "\"divtec_inf_rbgp_value\"", ",", "1.0", ",", "\"COMPOSANT\"", ")", ";", "addNote", "(", "divtec_inf_rbgp_value", ",", "db", ")", ";", "//endregion", "//region implements MOYENNES", "Note", "divtec_inf_moy_tot_cg", "=", "new", "Note", "(", "\"divtec_inf_moy_tot_cg\"", ",", "0.5", ",", "null", ")", ";", "addNote", "(", "divtec_inf_moy_tot_cg", ",", "db", ")", ";", "Note", "divtec_inf_moy_tot_atelier", "=", "new", "Note", "(", "\"divtec_inf_moy_tot_atelier\"", ",", "0.5", ",", "null", ")", ";", "addNote", "(", "divtec_inf_moy_tot_atelier", ",", "db", ")", ";", "Note", "divtec_inf_moy_tot_ept", "=", "new", "Note", "(", "\"divtec_inf_moy_tot_ept\"", ",", "0.5", ",", "null", ")", ";", "addNote", "(", "divtec_inf_moy_tot_ept", ",", "db", ")", ";", "Note", "divtec_inf_moy_tot_mod", "=", "new", "Note", "(", "\"divtec_inf_moy_tot_mod\"", ",", "0.5", ",", "null", ")", ";", "addNote", "(", "divtec_inf_moy_tot_mod", ",", "db", ")", ";", "Note", "divtec_inf_moy_tot_mod_interEntreprise", "=", "new", "Note", "(", "\"divtec_inf_moy_tot_mod_interEntreprise\"", ",", "0.5", ",", "null", ")", ";", "addNote", "(", "divtec_inf_moy_tot_mod_interEntreprise", ",", "db", ")", ";", "Note", "divtec_inf_moy_tot_mod_standard", "=", "new", "Note", "(", "\"divtec_inf_moy_tot_mod_standard\"", ",", "0.5", ",", "null", ")", ";", "addNote", "(", "divtec_inf_moy_tot_mod_standard", ",", "db", ")", ";", "Note", "divtec_inf_moy_tot_tot", "=", "new", "Note", "(", "\"divtec_inf_moy_tot_tot\"", ",", "0.5", ",", "null", ")", ";", "addNote", "(", "divtec_inf_moy_tot_tot", ",", "db", ")", ";", "//endregion", "// region implements MODULES", "Note", "divtec_inf_math_mi", "=", "new", "Note", "(", "\"MI\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "divtec_inf_math_mi", ",", "db", ")", ";", "Note", "mod_100", "=", "new", "Note", "(", "\"M100\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_100", ",", "db", ")", ";", "Note", "mod_101", "=", "new", "Note", "(", "\"M101\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_101", ",", "db", ")", ";", "Note", "mod_104", "=", "new", "Note", "(", "\"M104\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_104", ",", "db", ")", ";", "Note", "mod_105", "=", "new", "Note", "(", "\"M105\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_105", ",", "db", ")", ";", "Note", "mod_114", "=", "new", "Note", "(", "\"M114\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_114", ",", "db", ")", ";", "Note", "mod_115", "=", "new", "Note", "(", "\"M115\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_115", ",", "db", ")", ";", "Note", "mod_117", "=", "new", "Note", "(", "\"M117\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_117", ",", "db", ")", ";", "Note", "mod_122", "=", "new", "Note", "(", "\"M122\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_122", ",", "db", ")", ";", "Note", "mod_123", "=", "new", "Note", "(", "\"M123\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_123", ",", "db", ")", ";", "Note", "mod_124", "=", "new", "Note", "(", "\"M124\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_124", ",", "db", ")", ";", "Note", "mod_127", "=", "new", "Note", "(", "\"M127\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_127", ",", "db", ")", ";", "Note", "mod_129", "=", "new", "Note", "(", "\"M129\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_129", ",", "db", ")", ";", "Note", "mod_133", "=", "new", "Note", "(", "\"M133\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_133", ",", "db", ")", ";", "Note", "mod_140", "=", "new", "Note", "(", "\"M140\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_140", ",", "db", ")", ";", "Note", "mod_143", "=", "new", "Note", "(", "\"M143\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_143", ",", "db", ")", ";", "Note", "mod_145", "=", "new", "Note", "(", "\"M145\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_145", ",", "db", ")", ";", "Note", "mod_151", "=", "new", "Note", "(", "\"M151\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_151", ",", "db", ")", ";", "Note", "mod_153", "=", "new", "Note", "(", "\"M153\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_153", ",", "db", ")", ";", "Note", "mod_159", "=", "new", "Note", "(", "\"M159\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_159", ",", "db", ")", ";", "Note", "mod_182", "=", "new", "Note", "(", "\"M182\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_182", ",", "db", ")", ";", "Note", "mod_214", "=", "new", "Note", "(", "\"M214\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_214", ",", "db", ")", ";", "Note", "mod_226", "=", "new", "Note", "(", "\"M226\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_226", ",", "db", ")", ";", "Note", "mod_302", "=", "new", "Note", "(", "\"M302\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_302", ",", "db", ")", ";", "Note", "mod_304", "=", "new", "Note", "(", "\"M304\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_304", ",", "db", ")", ";", "Note", "mod_305", "=", "new", "Note", "(", "\"M305\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_305", ",", "db", ")", ";", "Note", "mod_306", "=", "new", "Note", "(", "\"M306\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_306", ",", "db", ")", ";", "Note", "mod_340", "=", "new", "Note", "(", "\"M340\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_340", ",", "db", ")", ";", "Note", "mod_403", "=", "new", "Note", "(", "\"M403\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_403", ",", "db", ")", ";", "Note", "mod_404", "=", "new", "Note", "(", "\"M404\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_404", ",", "db", ")", ";", "Note", "mod_431", "=", "new", "Note", "(", "\"M431\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_431", ",", "db", ")", ";", "Note", "mod_437", "=", "new", "Note", "(", "\"M437\"", ",", "0.5", ",", "\"MOD\"", ")", ";", "addNote", "(", "mod_437", ",", "db", ")", ";", "//endregion", "// region implements MATH", "//MATH", "Note", "divtec_inf_math_sem1", "=", "new", "Note", "(", "\"divtec_inf_math_sem1\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_math_sem1", ",", "db", ")", ";", "Note", "divtec_inf_math_sem2", "=", "new", "Note", "(", "\"divtec_inf_math_sem2\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_math_sem2", ",", "db", ")", ";", "Note", "divtec_inf_math_sem3", "=", "new", "Note", "(", "\"divtec_inf_math_sem3\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_math_sem3", ",", "db", ")", ";", "Note", "divtec_inf_math_sem4", "=", "new", "Note", "(", "\"divtec_inf_math_sem4\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_math_sem4", ",", "db", ")", ";", "Note", "divtec_inf_math_sem5", "=", "new", "Note", "(", "\"divtec_inf_math_sem5\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_math_sem5", ",", "db", ")", ";", "Note", "divtec_inf_math_sem6", "=", "new", "Note", "(", "\"divtec_inf_math_sem6\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_math_sem6", ",", "db", ")", ";", "Note", "divtec_inf_math_sem7", "=", "new", "Note", "(", "\"divtec_inf_math_sem7\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_math_sem7", ",", "db", ")", ";", "Note", "divtec_inf_math_sem8", "=", "new", "Note", "(", "\"divtec_inf_math_sem8\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_math_sem8", ",", "db", ")", ";", "Note", "divtec_inf_math_finale", "=", "new", "Note", "(", "\"divtec_inf_math_finale\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_math_finale", ",", "db", ")", ";", "// endregion implements", "// region implements SCIENCE", "Note", "divtec_inf_science_sem1", "=", "new", "Note", "(", "\"divtec_inf_science_sem1\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_science_sem1", ",", "db", ")", ";", "Note", "divtec_inf_science_sem2", "=", "new", "Note", "(", "\"divtec_inf_science_sem2\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_science_sem2", ",", "db", ")", ";", "Note", "divtec_inf_science_sem3", "=", "new", "Note", "(", "\"divtec_inf_science_sem3\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_science_sem3", ",", "db", ")", ";", "Note", "divtec_inf_science_sem4", "=", "new", "Note", "(", "\"divtec_inf_science_sem4\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_science_sem4", ",", "db", ")", ";", "Note", "divtec_inf_science_sem5", "=", "new", "Note", "(", "\"divtec_inf_science_sem5\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_science_sem5", ",", "db", ")", ";", "Note", "divtec_inf_science_sem6", "=", "new", "Note", "(", "\"divtec_inf_science_sem6\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_science_sem6", ",", "db", ")", ";", "Note", "divtec_inf_science_sem7", "=", "new", "Note", "(", "\"divtec_inf_science_sem7\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_science_sem7", ",", "db", ")", ";", "Note", "divtec_inf_science_sem8", "=", "new", "Note", "(", "\"divtec_inf_science_sem8\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_science_sem8", ",", "db", ")", ";", "Note", "divtec_inf_science_finale", "=", "new", "Note", "(", "\"divtec_inf_science_finale\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_science_finale", ",", "db", ")", ";", "// endregion implements", "// region implements ANGLAIS", "Note", "divtec_inf_anglais_sem1", "=", "new", "Note", "(", "\"divtec_inf_anglais_sem1\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_anglais_sem1", ",", "db", ")", ";", "Note", "divtec_inf_anglais_sem2", "=", "new", "Note", "(", "\"divtec_inf_anglais_sem2\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_anglais_sem2", ",", "db", ")", ";", "Note", "divtec_inf_anglais_sem3", "=", "new", "Note", "(", "\"divtec_inf_anglais_sem3\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_anglais_sem3", ",", "db", ")", ";", "Note", "divtec_inf_anglais_sem4", "=", "new", "Note", "(", "\"divtec_inf_anglais_sem4\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_anglais_sem4", ",", "db", ")", ";", "Note", "divtec_inf_anglais_sem5", "=", "new", "Note", "(", "\"divtec_inf_anglais_sem5\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_anglais_sem5", ",", "db", ")", ";", "Note", "divtec_inf_anglais_sem6", "=", "new", "Note", "(", "\"divtec_inf_anglais_sem6\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_anglais_sem6", ",", "db", ")", ";", "Note", "divtec_inf_anglais_sem7", "=", "new", "Note", "(", "\"divtec_inf_anglais_sem7\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_anglais_sem7", ",", "db", ")", ";", "Note", "divtec_inf_anglais_sem8", "=", "new", "Note", "(", "\"divtec_inf_anglais_sem8\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_anglais_sem8", ",", "db", ")", ";", "Note", "divtec_inf_anglais_finale", "=", "new", "Note", "(", "\"divtec_inf_anglais_finale\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_anglais_finale", ",", "db", ")", ";", "// endregion implements", "// region implements ECONOMIE", "Note", "divtec_inf_economie_sem1", "=", "new", "Note", "(", "\"divtec_inf_economie_sem1\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_economie_sem1", ",", "db", ")", ";", "Note", "divtec_inf_economie_sem2", "=", "new", "Note", "(", "\"divtec_inf_economie_sem2\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_economie_sem2", ",", "db", ")", ";", "Note", "divtec_inf_economie_sem3", "=", "new", "Note", "(", "\"divtec_inf_economie_sem3\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_economie_sem3", ",", "db", ")", ";", "Note", "divtec_inf_economie_sem4", "=", "new", "Note", "(", "\"divtec_inf_economie_sem4\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_economie_sem4", ",", "db", ")", ";", "Note", "divtec_inf_economie_sem5", "=", "new", "Note", "(", "\"divtec_inf_economie_sem5\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_economie_sem5", ",", "db", ")", ";", "Note", "divtec_inf_economie_sem6", "=", "new", "Note", "(", "\"divtec_inf_economie_sem6\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_economie_sem6", ",", "db", ")", ";", "Note", "divtec_inf_economie_sem7", "=", "new", "Note", "(", "\"divtec_inf_economie_sem7\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_economie_sem7", ",", "db", ")", ";", "Note", "divtec_inf_economie_sem8", "=", "new", "Note", "(", "\"divtec_inf_economie_sem8\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_economie_sem8", ",", "db", ")", ";", "Note", "divtec_inf_economie_finale", "=", "new", "Note", "(", "\"divtec_inf_economie_finale\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_economie_finale", ",", "db", ")", ";", "// endregion implements", "// region implements EDU PHYSIQUE", "Note", "divtec_inf_edu_physique_sem1", "=", "new", "Note", "(", "\"divtec_inf_edu_physique_sem1\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_sem1", ",", "db", ")", ";", "Note", "divtec_inf_edu_physique_sem2", "=", "new", "Note", "(", "\"divtec_inf_edu_physique_sem2\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_sem2", ",", "db", ")", ";", "Note", "divtec_inf_edu_physique_sem3", "=", "new", "Note", "(", "\"divtec_inf_edu_physique_sem3\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_sem3", ",", "db", ")", ";", "Note", "divtec_inf_edu_physique_sem4", "=", "new", "Note", "(", "\"divtec_inf_edu_physique_sem4\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_sem4", ",", "db", ")", ";", "Note", "divtec_inf_edu_physique_sem5", "=", "new", "Note", "(", "\"divtec_inf_edu_physique_sem5\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_sem5", ",", "db", ")", ";", "Note", "divtec_inf_edu_physique_sem6", "=", "new", "Note", "(", "\"divtec_inf_edu_physique_sem6\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_sem6", ",", "db", ")", ";", "Note", "divtec_inf_edu_physique_sem7", "=", "new", "Note", "(", "\"divtec_inf_edu_physique_sem7\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_sem7", ",", "db", ")", ";", "Note", "divtec_inf_edu_physique_sem8", "=", "new", "Note", "(", "\"divtec_inf_edu_physique_sem8\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_sem8", ",", "db", ")", ";", "Note", "divtec_inf_edu_physique_finale", "=", "new", "Note", "(", "\"divtec_inf_edu_physique_finale\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_finale", ",", "db", ")", ";", "// endregion implements", "//region implements Société", "Note", "divtec_inf_societe_sem1", "=", "new", "Note", "(", "\"divtec_inf_societe_sem1\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_societe_sem1", ",", "db", ")", ";", "Note", "divtec_inf_societe_sem2", "=", "new", "Note", "(", "\"divtec_inf_societe_sem2\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_societe_sem2", ",", "db", ")", ";", "Note", "divtec_inf_societe_sem3", "=", "new", "Note", "(", "\"divtec_inf_societe_sem3\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_societe_sem3", ",", "db", ")", ";", "Note", "divtec_inf_societe_sem4", "=", "new", "Note", "(", "\"divtec_inf_societe_sem4\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_societe_sem4", ",", "db", ")", ";", "Note", "divtec_inf_societe_sem5", "=", "new", "Note", "(", "\"divtec_inf_societe_sem5\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_societe_sem5", ",", "db", ")", ";", "Note", "divtec_inf_societe_sem6", "=", "new", "Note", "(", "\"divtec_inf_societe_sem6\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_societe_sem6", ",", "db", ")", ";", "Note", "divtec_inf_societe_sem7", "=", "new", "Note", "(", "\"divtec_inf_societe_sem7\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_societe_sem7", ",", "db", ")", ";", "Note", "divtec_inf_societe_sem8", "=", "new", "Note", "(", "\"divtec_inf_societe_sem8\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_societe_sem8", ",", "db", ")", ";", "//endregion", "// region implements Langue et Comm", "Note", "divtec_inf_langueEtComm_sem1", "=", "new", "Note", "(", "\"divtec_inf_langueEtComm_sem1\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_sem1", ",", "db", ")", ";", "Note", "divtec_inf_langueEtComm_sem2", "=", "new", "Note", "(", "\"divtec_inf_langueEtComm_sem2\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_sem1", ",", "db", ")", ";", "Note", "divtec_inf_langueEtComm_sem3", "=", "new", "Note", "(", "\"divtec_inf_langueEtComm_sem3\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_sem1", ",", "db", ")", ";", "Note", "divtec_inf_langueEtComm_sem4", "=", "new", "Note", "(", "\"divtec_inf_langueEtComm_sem4\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_sem1", ",", "db", ")", ";", "Note", "divtec_inf_langueEtComm_sem5", "=", "new", "Note", "(", "\"divtec_inf_langueEtComm_sem5\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_sem1", ",", "db", ")", ";", "Note", "divtec_inf_langueEtComm_sem6", "=", "new", "Note", "(", "\"divtec_inf_langueEtComm_sem6\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_sem1", ",", "db", ")", ";", "Note", "divtec_inf_langueEtComm_sem7", "=", "new", "Note", "(", "\"divtec_inf_langueEtComm_sem7\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_sem1", ",", "db", ")", ";", "Note", "divtec_inf_langueEtComm_sem8", "=", "new", "Note", "(", "\"divtec_inf_langueEtComm_sem8\"", ",", "0.5", ",", "\"EPT\"", ")", ";", "addNote", "(", "divtec_inf_edu_physique_sem1", ",", "db", ")", ";", "//endregion", "//region implements ATELIER", "Note", "divtec_inf_atelier_sem1", "=", "new", "Note", "(", "\"divtec_inf_atelier_sem1\"", ",", "0.5", ",", "\"ATE\"", ")", ";", "addNote", "(", "divtec_inf_atelier_sem1", ",", "db", ")", ";", "Note", "divtec_inf_atelier_sem2", "=", "new", "Note", "(", "\"divtec_inf_atelier_sem2\"", ",", "0.5", ",", "\"ATE\"", ")", ";", "addNote", "(", "divtec_inf_atelier_sem2", ",", "db", ")", ";", "Note", "divtec_inf_atelier_sem3", "=", "new", "Note", "(", "\"divtec_inf_atelier_sem3\"", ",", "0.5", ",", "\"ATE\"", ")", ";", "addNote", "(", "divtec_inf_atelier_sem3", ",", "db", ")", ";", "Note", "divtec_inf_atelier_sem4", "=", "new", "Note", "(", "\"divtec_inf_atelier_sem4\"", ",", "0.5", ",", "\"ATE\"", ")", ";", "addNote", "(", "divtec_inf_atelier_sem4", ",", "db", ")", ";", "Note", "divtec_inf_atelier_sem5", "=", "new", "Note", "(", "\"divtec_inf_atelier_sem5\"", ",", "0.5", ",", "\"ATE\"", ")", ";", "addNote", "(", "divtec_inf_atelier_sem5", ",", "db", ")", ";", "Note", "divtec_inf_atelier_sem6", "=", "new", "Note", "(", "\"divtec_inf_atelier_sem6\"", ",", "0.5", ",", "\"ATE\"", ")", ";", "addNote", "(", "divtec_inf_atelier_sem6", ",", "db", ")", ";", "Note", "divtec_inf_atelier_sem7", "=", "new", "Note", "(", "\"divtec_inf_atelier_sem7\"", ",", "0.5", ",", "\"ATE\"", ")", ";", "addNote", "(", "divtec_inf_atelier_sem7", ",", "db", ")", ";", "Note", "divtec_inf_atelier_sem8", "=", "new", "Note", "(", "\"divtec_inf_atelier_sem8\"", ",", "0.5", ",", "\"ATE\"", ")", ";", "addNote", "(", "divtec_inf_atelier_sem8", ",", "db", ")", ";", "//endregion", "}" ]
[ 54, 4 ]
[ 329, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
Main.
null
Récupère le contenu de document.xml dans une String pour que jinja puisse remplacer les {{placeholder}}
Récupère le contenu de document.xml dans une String pour que jinja puisse remplacer les {{placeholder}}
private static String readFile(String file) throws IOException { BufferedReader reader = new BufferedReader(new FileReader(file)); String line = null; StringBuilder stringBuilder = new StringBuilder(); String ls = System.getProperty("line.separator"); try { while((line = reader.readLine()) != null) { stringBuilder.append(line); //stringBuilder.append(ls); } return stringBuilder.toString(); } finally { reader.close(); //System.out.println("stringbuilder closed"); } }
[ "private", "static", "String", "readFile", "(", "String", "file", ")", "throws", "IOException", "{", "BufferedReader", "reader", "=", "new", "BufferedReader", "(", "new", "FileReader", "(", "file", ")", ")", ";", "String", "line", "=", "null", ";", "StringBuilder", "stringBuilder", "=", "new", "StringBuilder", "(", ")", ";", "String", "ls", "=", "System", ".", "getProperty", "(", "\"line.separator\"", ")", ";", "try", "{", "while", "(", "(", "line", "=", "reader", ".", "readLine", "(", ")", ")", "!=", "null", ")", "{", "stringBuilder", ".", "append", "(", "line", ")", ";", "//stringBuilder.append(ls);", "}", "return", "stringBuilder", ".", "toString", "(", ")", ";", "}", "finally", "{", "reader", ".", "close", "(", ")", ";", "//System.out.println(\"stringbuilder closed\");", "}", "}" ]
[ 22, 4 ]
[ 38, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
RestClasse.
null
-------------------Mettre à jour d'une classe d'un id donné--------------------------------------------------------
-------------------Mettre à jour d'une classe d'un id donné--------------------------------------------------------
@RequestMapping(value = "/{id}", method = RequestMethod.PUT) public ResponseEntity<ClasseEntity> majClasse(@PathVariable(value = "id") int id,@RequestBody ClasseEntity nouvclasse) throws Exception{ System.out.println("maj de la classe id = " + id); ClasseEntity cl = mdcl.read(id); mdcl.update(cl,nouvclasse); return new ResponseEntity<>(cl, HttpStatus.OK); }
[ "@", "RequestMapping", "(", "value", "=", "\"/{id}\"", ",", "method", "=", "RequestMethod", ".", "PUT", ")", "public", "ResponseEntity", "<", "ClasseEntity", ">", "majClasse", "(", "@", "PathVariable", "(", "value", "=", "\"id\"", ")", "int", "id", ",", "@", "RequestBody", "ClasseEntity", "nouvclasse", ")", "throws", "Exception", "{", "System", ".", "out", ".", "println", "(", "\"maj de la classe id = \"", "+", "id", ")", ";", "ClasseEntity", "cl", "=", "mdcl", ".", "read", "(", "id", ")", ";", "mdcl", ".", "update", "(", "cl", ",", "nouvclasse", ")", ";", "return", "new", "ResponseEntity", "<>", "(", "cl", ",", "HttpStatus", ".", "OK", ")", ";", "}" ]
[ 51, 4 ]
[ 57, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
Element.
null
TODO Prendre en compte la force du nuage de poison en param�tre
TODO Prendre en compte la force du nuage de poison en param�tre
public void createPoisonCloud() { if (this.poisonClouds == null) { this.poisonClouds = new ArrayList<PoisonCloud>(); } // if (log.isDebugEnabled()) { // log.debug("Creating new poison cloud on " + this + " ..."); // } final PoisonCloud poisonCloud = new PoisonCloud(this); // S'enregistrer pour savoir quand le nuage dispara�t poisonCloud.addChangeListener(new ChangeListener() { @Override public void onChangeEvent(ChangeEvent event) { if (log.isDebugEnabled()) { log.debug(event.getSource() + " vanished into thin air"); } poisonClouds.remove(event.getSource()); if (poisonClouds.isEmpty()) { poisonClouds = null; } } }); // M�moriser le nuage this.poisonClouds.add(poisonCloud); if (log.isDebugEnabled()) { log.debug("Created a new poison cloud on " + this); } // Enregistrer ce nuage Clock.getInstance().register(poisonCloud); }
[ "public", "void", "createPoisonCloud", "(", ")", "{", "if", "(", "this", ".", "poisonClouds", "==", "null", ")", "{", "this", ".", "poisonClouds", "=", "new", "ArrayList", "<", "PoisonCloud", ">", "(", ")", ";", "}", "//\t\tif (log.isDebugEnabled()) {", "//\t\t\tlog.debug(\"Creating new poison cloud on \" + this + \" ...\");", "//\t\t}", "final", "PoisonCloud", "poisonCloud", "=", "new", "PoisonCloud", "(", "this", ")", ";", "// S'enregistrer pour savoir quand le nuage dispara�t", "poisonCloud", ".", "addChangeListener", "(", "new", "ChangeListener", "(", ")", "{", "@", "Override", "public", "void", "onChangeEvent", "(", "ChangeEvent", "event", ")", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "{", "log", ".", "debug", "(", "event", ".", "getSource", "(", ")", "+", "\" vanished into thin air\"", ")", ";", "}", "poisonClouds", ".", "remove", "(", "event", ".", "getSource", "(", ")", ")", ";", "if", "(", "poisonClouds", ".", "isEmpty", "(", ")", ")", "{", "poisonClouds", "=", "null", ";", "}", "}", "}", ")", ";", "// M�moriser le nuage", "this", ".", "poisonClouds", ".", "add", "(", "poisonCloud", ")", ";", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "{", "log", ".", "debug", "(", "\"Created a new poison cloud on \"", "+", "this", ")", ";", "}", "// Enregistrer ce nuage", "Clock", ".", "getInstance", "(", ")", ".", "register", "(", "poisonCloud", ")", ";", "}" ]
[ 969, 1 ]
[ 1005, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
ContenusRightPolicyFilter.
null
/* Si la requete ne possède pas le header "Client-Origin", on a affaire à un agent DEP Ce header est positionné sur le reverse-proxy par l'équipe réseau.
/* Si la requete ne possède pas le header "Client-Origin", on a affaire à un agent DEP Ce header est positionné sur le reverse-proxy par l'équipe réseau.
public static boolean isAgent(){ HttpServletRequest request = channel.getCurrentJcmsContext().getRequest(); if(Util.isEmpty(request.getHeader("Client-Origin"))){ return true; } return false; }
[ "public", "static", "boolean", "isAgent", "(", ")", "{", "HttpServletRequest", "request", "=", "channel", ".", "getCurrentJcmsContext", "(", ")", ".", "getRequest", "(", ")", ";", "if", "(", "Util", ".", "isEmpty", "(", "request", ".", "getHeader", "(", "\"Client-Origin\"", ")", ")", ")", "{", "return", "true", ";", "}", "return", "false", ";", "}" ]
[ 64, 1 ]
[ 71, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
CleanXml.
null
Ajoute un espace entre les délimiteurs {% / %} et leur contenu
Ajoute un espace entre les délimiteurs {% / %} et leur contenu
private static List<String> cleanEspaces(List<String> listeProbleme, int leftOrRight) { // UPDATE: les espaces n'empêchent pas le bon fonctionnement, cela ne change rien au final // Aucune différence de fonctionnement entre {% for A in B %} et {%for a in B %} List<String> listeClean = new ArrayList<>(listeProbleme); if (!(listeClean.isEmpty())) { String remplacement; if (leftOrRight == 0) { for (int i = 0; i < listeClean.size(); i++) { remplacement = listeClean.get(i).substring(0, 2) + " " + listeClean.get(i).substring(2); listeClean.set(i, remplacement); } } else { for (int i = 0; i < listeClean.size(); i++) { remplacement = listeClean.get(i).substring(0, 1) + " " + listeClean.get(i).substring(1, 3); listeClean.set(i, remplacement); } } } return listeClean; }
[ "private", "static", "List", "<", "String", ">", "cleanEspaces", "(", "List", "<", "String", ">", "listeProbleme", ",", "int", "leftOrRight", ")", "{", "// UPDATE: les espaces n'empêchent pas le bon fonctionnement, cela ne change rien au final", "// Aucune différence de fonctionnement entre {% for A in B %} et {%for a in B %}", "List", "<", "String", ">", "listeClean", "=", "new", "ArrayList", "<>", "(", "listeProbleme", ")", ";", "if", "(", "!", "(", "listeClean", ".", "isEmpty", "(", ")", ")", ")", "{", "String", "remplacement", ";", "if", "(", "leftOrRight", "==", "0", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "listeClean", ".", "size", "(", ")", ";", "i", "++", ")", "{", "remplacement", "=", "listeClean", ".", "get", "(", "i", ")", ".", "substring", "(", "0", ",", "2", ")", "+", "\" \"", "+", "listeClean", ".", "get", "(", "i", ")", ".", "substring", "(", "2", ")", ";", "listeClean", ".", "set", "(", "i", ",", "remplacement", ")", ";", "}", "}", "else", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "listeClean", ".", "size", "(", ")", ";", "i", "++", ")", "{", "remplacement", "=", "listeClean", ".", "get", "(", "i", ")", ".", "substring", "(", "0", ",", "1", ")", "+", "\" \"", "+", "listeClean", ".", "get", "(", "i", ")", ".", "substring", "(", "1", ",", "3", ")", ";", "listeClean", ".", "set", "(", "i", ",", "remplacement", ")", ";", "}", "}", "}", "return", "listeClean", ";", "}" ]
[ 151, 4 ]
[ 171, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
RestEleve.
null
-------------------Retrouver l'élève correspondant à une date donnée--------------------------------------------------------
-------------------Retrouver l'élève correspondant à une date donnée--------------------------------------------------------
@RequestMapping(value = "/date={date}", method = RequestMethod.GET) public ResponseEntity<List<EleveEntity>> getEleve(@PathVariable(value = "date") Date date) throws Exception{ System.out.println("recherche de l'élève de date " + date); List<EleveEntity> eleves = mde.rechDate(date); return new ResponseEntity<>(eleves, HttpStatus.OK); }
[ "@", "RequestMapping", "(", "value", "=", "\"/date={date}\"", ",", "method", "=", "RequestMethod", ".", "GET", ")", "public", "ResponseEntity", "<", "List", "<", "EleveEntity", ">", ">", "getEleve", "(", "@", "PathVariable", "(", "value", "=", "\"date\"", ")", "Date", "date", ")", "throws", "Exception", "{", "System", ".", "out", ".", "println", "(", "\"recherche de l'élève de date \" +", "d", "te);", "", "", "List", "<", "EleveEntity", ">", "eleves", "=", "mde", ".", "rechDate", "(", "date", ")", ";", "return", "new", "ResponseEntity", "<>", "(", "eleves", ",", "HttpStatus", ".", "OK", ")", ";", "}" ]
[ 45, 4 ]
[ 50, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
JpaPersistence.
null
il ne faut donc pas appeler initJpaCounter() dans le constructeur
il ne faut donc pas appeler initJpaCounter() dans le constructeur
private void initJpaCounter() { // quand cette classe est utilisée, le compteur est affiché // sauf si le paramètre displayed-counters dit le contraire JPA_COUNTER.setDisplayed(!COUNTER_HIDDEN); // setUsed(true) nécessaire ici si le contexte jpa est initialisé avant FilterContext // sinon les statistiques jpa ne sont pas affichées JPA_COUNTER.setUsed(true); LOG.debug("jpa persistence initialized"); }
[ "private", "void", "initJpaCounter", "(", ")", "{", "// quand cette classe est utilisée, le compteur est affiché\r", "// sauf si le paramètre displayed-counters dit le contraire\r", "JPA_COUNTER", ".", "setDisplayed", "(", "!", "COUNTER_HIDDEN", ")", ";", "// setUsed(true) nécessaire ici si le contexte jpa est initialisé avant FilterContext\r", "// sinon les statistiques jpa ne sont pas affichées\r", "JPA_COUNTER", ".", "setUsed", "(", "true", ")", ";", "LOG", ".", "debug", "(", "\"jpa persistence initialized\"", ")", ";", "}" ]
[ 142, 1 ]
[ 150, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
HashService.
null
TOSO optimisation : cache avec map
TOSO optimisation : cache avec map
public SecretKeySpec getSecretKey(String hmacKey) { return new SecretKeySpec(DatatypeConverter.parseHexBinary(hmacKey), "HmacSHA512" ); }
[ "public", "SecretKeySpec", "getSecretKey", "(", "String", "hmacKey", ")", "{", "return", "new", "SecretKeySpec", "(", "DatatypeConverter", ".", "parseHexBinary", "(", "hmacKey", ")", ",", "\"HmacSHA512\"", ")", ";", "}" ]
[ 41, 1 ]
[ 43, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
fragmentDivtecInfBulletin.
null
Remplit toutes les textView
Remplit toutes les textView
public void remplAllTxtVi(NoteSQLiteOpenHelper noteHelper) { remplTxtViewMath(noteHelper); remplTxtViewAnglais(noteHelper); remplTxtViewEconomie(noteHelper); remplTxtViewEduPhy(noteHelper); remplTxtViewScience(noteHelper); remplTxtViewModules(noteHelper); remplTxtViewMoyTot(noteHelper); remplTxtViewSociete(noteHelper); remplTxtViewLangueEtComm(noteHelper); remplTxtViewAtelier(noteHelper); }
[ "public", "void", "remplAllTxtVi", "(", "NoteSQLiteOpenHelper", "noteHelper", ")", "{", "remplTxtViewMath", "(", "noteHelper", ")", ";", "remplTxtViewAnglais", "(", "noteHelper", ")", ";", "remplTxtViewEconomie", "(", "noteHelper", ")", ";", "remplTxtViewEduPhy", "(", "noteHelper", ")", ";", "remplTxtViewScience", "(", "noteHelper", ")", ";", "remplTxtViewModules", "(", "noteHelper", ")", ";", "remplTxtViewMoyTot", "(", "noteHelper", ")", ";", "remplTxtViewSociete", "(", "noteHelper", ")", ";", "remplTxtViewLangueEtComm", "(", "noteHelper", ")", ";", "remplTxtViewAtelier", "(", "noteHelper", ")", ";", "}" ]
[ 421, 4 ]
[ 432, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
Main.
null
Dézippe le template en affichant l'output de l'OS dans la console
Dézippe le template en affichant l'output de l'OS dans la console
private static boolean unzip() throws IOException, InterruptedException { boolean bool = true; System.out.println("Unzipping..."); try { ProcessBuilder pb = new ProcessBuilder(); pb.command("src/main/resources/unzip.sh"); Process process = pb.start(); BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); String line; while ((line = reader.readLine()) != null) System.out.println("unzip process: " + line); int exitVal = process.waitFor(); if (exitVal == 0) { System.out.println("unzip success!"); } else { System.out.println("Le dézippage s'est terminé avec un code " + exitVal + " (anormal)"); bool = false; } } catch (Exception e){ bool = false; System.out.println(e.getMessage()); e.printStackTrace(); } finally { return bool; } }
[ "private", "static", "boolean", "unzip", "(", ")", "throws", "IOException", ",", "InterruptedException", "{", "boolean", "bool", "=", "true", ";", "System", ".", "out", ".", "println", "(", "\"Unzipping...\"", ")", ";", "try", "{", "ProcessBuilder", "pb", "=", "new", "ProcessBuilder", "(", ")", ";", "pb", ".", "command", "(", "\"src/main/resources/unzip.sh\"", ")", ";", "Process", "process", "=", "pb", ".", "start", "(", ")", ";", "BufferedReader", "reader", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "process", ".", "getInputStream", "(", ")", ")", ")", ";", "String", "line", ";", "while", "(", "(", "line", "=", "reader", ".", "readLine", "(", ")", ")", "!=", "null", ")", "System", ".", "out", ".", "println", "(", "\"unzip process: \"", "+", "line", ")", ";", "int", "exitVal", "=", "process", ".", "waitFor", "(", ")", ";", "if", "(", "exitVal", "==", "0", ")", "{", "System", ".", "out", ".", "println", "(", "\"unzip success!\"", ")", ";", "}", "else", "{", "System", ".", "out", ".", "println", "(", "\"Le dézippage s'est terminé avec un code \" +", "e", "itVal +", "\"", "(anormal)\");", "", "", "bool", "=", "false", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "bool", "=", "false", ";", "System", ".", "out", ".", "println", "(", "e", ".", "getMessage", "(", ")", ")", ";", "e", ".", "printStackTrace", "(", ")", ";", "}", "finally", "{", "return", "bool", ";", "}", "}" ]
[ 81, 4 ]
[ 107, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
ProduitController.
null
retourne la liste des produits pur une categorie donnee
retourne la liste des produits pur une categorie donnee
public List<Produit> findByCategorie(Categorie categorie){ Query query = em.createNamedQuery("Produit.findByCategorie"); query.setParameter("categorie",categorie.toString()); @SuppressWarnings("unchecked") List<Produit> results = query.getResultList(); return results; }
[ "public", "List", "<", "Produit", ">", "findByCategorie", "(", "Categorie", "categorie", ")", "{", "Query", "query", "=", "em", ".", "createNamedQuery", "(", "\"Produit.findByCategorie\"", ")", ";", "query", ".", "setParameter", "(", "\"categorie\"", ",", "categorie", ".", "toString", "(", ")", ")", ";", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "List", "<", "Produit", ">", "results", "=", "query", ".", "getResultList", "(", ")", ";", "return", "results", ";", "}" ]
[ 60, 1 ]
[ 66, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
SejourTest.
null
Tests sur le nombre de jours
Tests sur le nombre de jours
@Test public void testNombreJoursDebutMatinEtFinApresMidi() { Sejour sejour = new Sejour(toDate("01/01/2015"), PeriodeJournee.MATIN, toDate("10/01/2015"), PeriodeJournee.APRES_MIDI); Assertions.assertEquals(10, sejour.nombreJours().intValue()); }
[ "@", "Test", "public", "void", "testNombreJoursDebutMatinEtFinApresMidi", "(", ")", "{", "Sejour", "sejour", "=", "new", "Sejour", "(", "toDate", "(", "\"01/01/2015\"", ")", ",", "PeriodeJournee", ".", "MATIN", ",", "toDate", "(", "\"10/01/2015\"", ")", ",", "PeriodeJournee", ".", "APRES_MIDI", ")", ";", "Assertions", ".", "assertEquals", "(", "10", ",", "sejour", ".", "nombreJours", "(", ")", ".", "intValue", "(", ")", ")", ";", "}" ]
[ 25, 4 ]
[ 29, 5 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
Constantes.
null
Liste des composants
Liste des composants
public static Map<String, Triplet<List<Pair<String, Integer>>, String, String>> getJabberComponentsConfigList() { final Map<String, Triplet<List<Pair<String, Integer>>, String, String>> components = new HashMap<String, Triplet<List<Pair<String, Integer>>, String, String>>(); //{[componenthostName:componentPort],[componenthostName:componentPort]}; // componentName;componentPassword final PropertiesTools pTools = new PropertiesTools(); pTools.load("jabber_components_list.properties"); for (final Entry<Object, Object> anEntry : pTools.getAllProperties().entrySet()) { final String[] theValues = ((String) anEntry.getValue()).split(";"); if (theValues.length == 3) { final List<Pair<String, Integer>> pairs = new ArrayList<Pair<String, Integer>>(); final String[] hosts = theValues[0].split(net.violet.common.StringShop.COMMA); for (String host : hosts) { host = host.replaceAll("(\\[|\\]|\\{|\\}|,)", net.violet.common.StringShop.EMPTY_STRING); final String[] hostInfos = host.split(":"); if (hostInfos.length == 2) { pairs.add(new Pair<String, Integer>(hostInfos[0], Integer.parseInt(hostInfos[1]))); } } if (pairs.size() > 0) { components.put((String) anEntry.getKey(), new Triplet<List<Pair<String, Integer>>, String, String>(pairs, theValues[1], theValues[2])); } } } return components; }
[ "public", "static", "Map", "<", "String", ",", "Triplet", "<", "List", "<", "Pair", "<", "String", ",", "Integer", ">", ">", ",", "String", ",", "String", ">", ">", "getJabberComponentsConfigList", "(", ")", "{", "final", "Map", "<", "String", ",", "Triplet", "<", "List", "<", "Pair", "<", "String", ",", "Integer", ">", ">", ",", "String", ",", "String", ">", ">", "components", "=", "new", "HashMap", "<", "String", ",", "Triplet", "<", "List", "<", "Pair", "<", "String", ",", "Integer", ">", ">", ",", "String", ",", "String", ">", ">", "(", ")", ";", "//{[componenthostName:componentPort],[componenthostName:componentPort]};", "// componentName;componentPassword", "final", "PropertiesTools", "pTools", "=", "new", "PropertiesTools", "(", ")", ";", "pTools", ".", "load", "(", "\"jabber_components_list.properties\"", ")", ";", "for", "(", "final", "Entry", "<", "Object", ",", "Object", ">", "anEntry", ":", "pTools", ".", "getAllProperties", "(", ")", ".", "entrySet", "(", ")", ")", "{", "final", "String", "[", "]", "theValues", "=", "(", "(", "String", ")", "anEntry", ".", "getValue", "(", ")", ")", ".", "split", "(", "\";\"", ")", ";", "if", "(", "theValues", ".", "length", "==", "3", ")", "{", "final", "List", "<", "Pair", "<", "String", ",", "Integer", ">", ">", "pairs", "=", "new", "ArrayList", "<", "Pair", "<", "String", ",", "Integer", ">", ">", "(", ")", ";", "final", "String", "[", "]", "hosts", "=", "theValues", "[", "0", "]", ".", "split", "(", "net", ".", "violet", ".", "common", ".", "StringShop", ".", "COMMA", ")", ";", "for", "(", "String", "host", ":", "hosts", ")", "{", "host", "=", "host", ".", "replaceAll", "(", "\"(\\\\[|\\\\]|\\\\{|\\\\}|,)\"", ",", "net", ".", "violet", ".", "common", ".", "StringShop", ".", "EMPTY_STRING", ")", ";", "final", "String", "[", "]", "hostInfos", "=", "host", ".", "split", "(", "\":\"", ")", ";", "if", "(", "hostInfos", ".", "length", "==", "2", ")", "{", "pairs", ".", "add", "(", "new", "Pair", "<", "String", ",", "Integer", ">", "(", "hostInfos", "[", "0", "]", ",", "Integer", ".", "parseInt", "(", "hostInfos", "[", "1", "]", ")", ")", ")", ";", "}", "}", "if", "(", "pairs", ".", "size", "(", ")", ">", "0", ")", "{", "components", ".", "put", "(", "(", "String", ")", "anEntry", ".", "getKey", "(", ")", ",", "new", "Triplet", "<", "List", "<", "Pair", "<", "String", ",", "Integer", ">", ">", ",", "String", ",", "String", ">", "(", "pairs", ",", "theValues", "[", "1", "]", ",", "theValues", "[", "2", "]", ")", ")", ";", "}", "}", "}", "return", "components", ";", "}" ]
[ 273, 1 ]
[ 300, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
CounterRequest.
null
retourne l'id supposé unique de la requête pour le stockage
retourne l'id supposé unique de la requête pour le stockage
private static String buildId(String name, String counterName) { final MessageDigest messageDigest = getMessageDigestInstance(); messageDigest.update(name.getBytes()); final byte[] digest = messageDigest.digest(); final int l = counterName.length(); final char[] chars = new char[l + digest.length * 2]; // copie du counterName au début de chars counterName.getChars(0, l, chars, 0); // encodage en chaîne hexadécimale du digest, // puisque les caractères bizarres ne peuvent être utilisés sur un système de fichiers for (int j = 0; j < digest.length; j++) { final int v = digest[j] & 0xFF; chars[j * 2 + l] = HEX_ARRAY[v >>> 4]; chars[j * 2 + 1 + l] = HEX_ARRAY[v & 0x0F]; } return new String(chars); }
[ "private", "static", "String", "buildId", "(", "String", "name", ",", "String", "counterName", ")", "{", "final", "MessageDigest", "messageDigest", "=", "getMessageDigestInstance", "(", ")", ";", "messageDigest", ".", "update", "(", "name", ".", "getBytes", "(", ")", ")", ";", "final", "byte", "[", "]", "digest", "=", "messageDigest", ".", "digest", "(", ")", ";", "final", "int", "l", "=", "counterName", ".", "length", "(", ")", ";", "final", "char", "[", "]", "chars", "=", "new", "char", "[", "l", "+", "digest", ".", "length", "*", "2", "]", ";", "// copie du counterName au début de chars\r", "counterName", ".", "getChars", "(", "0", ",", "l", ",", "chars", ",", "0", ")", ";", "// encodage en chaîne hexadécimale du digest,\r", "// puisque les caractères bizarres ne peuvent être utilisés sur un système de fichiers\r", "for", "(", "int", "j", "=", "0", ";", "j", "<", "digest", ".", "length", ";", "j", "++", ")", "{", "final", "int", "v", "=", "digest", "[", "j", "]", "&", "0xFF", ";", "chars", "[", "j", "*", "2", "+", "l", "]", "=", "HEX_ARRAY", "[", "v", ">>>", "4", "]", ";", "chars", "[", "j", "*", "2", "+", "1", "+", "l", "]", "=", "HEX_ARRAY", "[", "v", "&", "0x0F", "]", ";", "}", "return", "new", "String", "(", "chars", ")", ";", "}" ]
[ 451, 1 ]
[ 468, 2 ]
null
java
fr
['fr', 'fr', 'fr']
True
true
method_declaration
Conexao.
null
---> constroi fabrica de sessao
---> constroi fabrica de sessao
private static SessionFactory buildSessionFactory() { // --->objeto que armazena as configuracoes de conexao configuracao = new Configuration().configure(); //-----> configura o acesso ao bd configuracao.setProperty("hibernate.connection.username", "root"); configuracao.setProperty("hibernate.connection.password", ""); //-----> indicando mapeamento das classe configuracao.addPackage("com.equipe2.clinicalsystem.model").addAnnotatedClass(Paciente.class); configuracao.addPackage("com.equipe2.clinicalsystem.model").addAnnotatedClass(Medico.class); configuracao.addPackage("com.equipe2.clinicalsystem.model").addAnnotatedClass(Atendente.class); configuracao.addPackage("com.equipe2.clinicalsystem.model").addAnnotatedClass(Consulta.class); configuracao.addPackage("com.equipe2.clinicalsystem.model").addAnnotatedClass(Login.class); //-->pega a conexao conexao = configuracao.buildSessionFactory(); //--> retornar a conexao pra quem chamou return conexao; }
[ "private", "static", "SessionFactory", "buildSessionFactory", "(", ")", "{", "// --->objeto que armazena as configuracoes de conexao", "configuracao", "=", "new", "Configuration", "(", ")", ".", "configure", "(", ")", ";", "//-----> configura o acesso ao bd", "configuracao", ".", "setProperty", "(", "\"hibernate.connection.username\"", ",", "\"root\"", ")", ";", "configuracao", ".", "setProperty", "(", "\"hibernate.connection.password\"", ",", "\"\"", ")", ";", "//-----> indicando mapeamento das classe", "configuracao", ".", "addPackage", "(", "\"com.equipe2.clinicalsystem.model\"", ")", ".", "addAnnotatedClass", "(", "Paciente", ".", "class", ")", ";", "configuracao", ".", "addPackage", "(", "\"com.equipe2.clinicalsystem.model\"", ")", ".", "addAnnotatedClass", "(", "Medico", ".", "class", ")", ";", "configuracao", ".", "addPackage", "(", "\"com.equipe2.clinicalsystem.model\"", ")", ".", "addAnnotatedClass", "(", "Atendente", ".", "class", ")", ";", "configuracao", ".", "addPackage", "(", "\"com.equipe2.clinicalsystem.model\"", ")", ".", "addAnnotatedClass", "(", "Consulta", ".", "class", ")", ";", "configuracao", ".", "addPackage", "(", "\"com.equipe2.clinicalsystem.model\"", ")", ".", "addAnnotatedClass", "(", "Login", ".", "class", ")", ";", "//-->pega a conexao ", "conexao", "=", "configuracao", ".", "buildSessionFactory", "(", ")", ";", "//--> retornar a conexao pra quem chamou", "return", "conexao", ";", "}" ]
[ 17, 4 ]
[ 38, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
aula05ex.
null
1. Construir um vetor de números naturais até um dado número n. Exemplo: naturals(5)->{1,2,3,4,5}
1. Construir um vetor de números naturais até um dado número n. Exemplo: naturals(5)->{1,2,3,4,5}
public static int[] naturals(int n){ int[] intArray = new int[n]; for (int i=0; i<n; i++){ intArray[i] = i+1; } return intArray; }
[ "public", "static", "int", "[", "]", "naturals", "(", "int", "n", ")", "{", "int", "[", "]", "intArray", "=", "new", "int", "[", "n", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "n", ";", "i", "++", ")", "{", "intArray", "[", "i", "]", "=", "i", "+", "1", ";", "}", "return", "intArray", ";", "}" ]
[ 69, 4 ]
[ 75, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Rectangulo.
null
verifica se é quadrado
verifica se é quadrado
public boolean eQuadrado(){ // Retorna um booleano conforme os lados forem iguais return getComprimento() == getLargura(); }
[ "public", "boolean", "eQuadrado", "(", ")", "{", "// Retorna um booleano conforme os lados forem iguais", "return", "getComprimento", "(", ")", "==", "getLargura", "(", ")", ";", "}" ]
[ 56, 4 ]
[ 59, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Cliente.
null
método que envia as mensagens para o servidor
método que envia as mensagens para o servidor
public void envia(String mensagem){ saida.println(mensagem); }
[ "public", "void", "envia", "(", "String", "mensagem", ")", "{", "saida", ".", "println", "(", "mensagem", ")", ";", "}" ]
[ 41, 4 ]
[ 43, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
App.
null
Função que passa os elementos da página como parâmetro
Função que passa os elementos da página como parâmetro
public List<String> getURLInfoPagePost() { Elements elements = document.getAllElements(); return getURLPagesPost(elements.eq(0)); }
[ "public", "List", "<", "String", ">", "getURLInfoPagePost", "(", ")", "{", "Elements", "elements", "=", "document", ".", "getAllElements", "(", ")", ";", "return", "getURLPagesPost", "(", "elements", ".", "eq", "(", "0", ")", ")", ";", "}" ]
[ 146, 1 ]
[ 149, 2 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
QuickSort.
null
===== Métodos de Ordenação por Latitude ===== //
===== Métodos de Ordenação por Latitude ===== //
public void quickLatitudeCres() { quickLatitudeCres(0, lista.size() - 1); }
[ "public", "void", "quickLatitudeCres", "(", ")", "{", "quickLatitudeCres", "(", "0", ",", "lista", ".", "size", "(", ")", "-", "1", ")", ";", "}" ]
[ 827, 4 ]
[ 829, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Peao.
null
Movimentos possíveis
Movimentos possíveis
public ArrayList<int[]> movPossiveis() { // Obtem posicao da peca e separa em coordenada int[] pos = getPosicao(); int x = pos[0]; int y = pos[1]; //Cria lista para guardar movimentos possiveis ArrayList<int[]> possiveis = new ArrayList<int[]>(); //Se a peça for branca anda para a frente (1 ou 2 casas) if (cor == "branca") { // Testa se os movimentos possiveis nao ultrapassam os limites do tabuleiro if (y + 1 <= maxY()) { //Cria vector para guardar cada movimento int[] mov = new int[2]; mov[0] = x; mov[1] = y + 1; possiveis.add(mov); } // Testa se os movimentos possiveis nao ultrapassam os limites do tabuleiro if (y + 2 <= maxY()) { //Cria vector para guardar cada movimento int[] mov = new int[2]; mov[0] = x; mov[1] = y + 2 ; possiveis.add(mov); } // Se a peça for preta anda para tras (1 ou 2 casas) } else if (cor == "preta") { // Testa se os movimentos possiveis nao ultrapassam os limites do tabuleiro if (y - 1 >= 0) { //Cria vector para guardar cada movimento int[] mov = new int[2]; mov[0] = x; mov[1] = y - 1; possiveis.add(mov); } // Testa se os movimentos possiveis nao ultrapassam os limites do tabuleiro if (y - 2 >= 0) { //Cria vector para guardar cada movimento int[] mov = new int[2]; mov[0] = x; mov[1] = y -2; possiveis.add(mov); } } return possiveis; }
[ "public", "ArrayList", "<", "int", "[", "]", ">", "movPossiveis", "(", ")", "{", "// Obtem posicao da peca e separa em coordenada", "int", "[", "]", "pos", "=", "getPosicao", "(", ")", ";", "int", "x", "=", "pos", "[", "0", "]", ";", "int", "y", "=", "pos", "[", "1", "]", ";", "//Cria lista para guardar movimentos possiveis", "ArrayList", "<", "int", "[", "]", ">", "possiveis", "=", "new", "ArrayList", "<", "int", "[", "]", ">", "(", ")", ";", "//Se a peça for branca anda para a frente (1 ou 2 casas)", "if", "(", "cor", "==", "\"branca\"", ")", "{", "// Testa se os movimentos possiveis nao ultrapassam os limites do tabuleiro", "if", "(", "y", "+", "1", "<=", "maxY", "(", ")", ")", "{", "//Cria vector para guardar cada movimento", "int", "[", "]", "mov", "=", "new", "int", "[", "2", "]", ";", "mov", "[", "0", "]", "=", "x", ";", "mov", "[", "1", "]", "=", "y", "+", "1", ";", "possiveis", ".", "add", "(", "mov", ")", ";", "}", "// Testa se os movimentos possiveis nao ultrapassam os limites do tabuleiro", "if", "(", "y", "+", "2", "<=", "maxY", "(", ")", ")", "{", "//Cria vector para guardar cada movimento", "int", "[", "]", "mov", "=", "new", "int", "[", "2", "]", ";", "mov", "[", "0", "]", "=", "x", ";", "mov", "[", "1", "]", "=", "y", "+", "2", ";", "possiveis", ".", "add", "(", "mov", ")", ";", "}", "// Se a peça for preta anda para tras (1 ou 2 casas)", "}", "else", "if", "(", "cor", "==", "\"preta\"", ")", "{", "// Testa se os movimentos possiveis nao ultrapassam os limites do tabuleiro", "if", "(", "y", "-", "1", ">=", "0", ")", "{", "//Cria vector para guardar cada movimento", "int", "[", "]", "mov", "=", "new", "int", "[", "2", "]", ";", "mov", "[", "0", "]", "=", "x", ";", "mov", "[", "1", "]", "=", "y", "-", "1", ";", "possiveis", ".", "add", "(", "mov", ")", ";", "}", "// Testa se os movimentos possiveis nao ultrapassam os limites do tabuleiro", "if", "(", "y", "-", "2", ">=", "0", ")", "{", "//Cria vector para guardar cada movimento", "int", "[", "]", "mov", "=", "new", "int", "[", "2", "]", ";", "mov", "[", "0", "]", "=", "x", ";", "mov", "[", "1", "]", "=", "y", "-", "2", ";", "possiveis", ".", "add", "(", "mov", ")", ";", "}", "}", "return", "possiveis", ";", "}" ]
[ 29, 4 ]
[ 72, 5 ]
null
java
pt
['pt', 'pt', 'pt']
False
true
method_declaration
VeiculoLeve.
null
====== IMPRESSÃO ======
====== IMPRESSÃO ======
@Override public String toString() { String print = "teste" ; return print; }
[ "@", "Override", "public", "String", "toString", "(", ")", "{", "String", "print", "=", "\"teste\"", ";", "return", "print", ";", "}" ]
[ 54, 4 ]
[ 58, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Main.
null
=========== Método para deletar um usuario pelo Id ===========
=========== Método para deletar um usuario pelo Id ===========
private void deletar() { try { Scanner entrada = new Scanner(System.in); System.out.print("Digite o id para ser deletado: "); String id = entrada.nextLine(); Cadastro.dao.UsuarioDAO.deletar(id); } catch (SQLException exception) { System.out.println("Erro ao Deletar: " + exception); } }
[ "private", "void", "deletar", "(", ")", "{", "try", "{", "Scanner", "entrada", "=", "new", "Scanner", "(", "System", ".", "in", ")", ";", "System", ".", "out", ".", "print", "(", "\"Digite o id para ser deletado: \"", ")", ";", "String", "id", "=", "entrada", ".", "nextLine", "(", ")", ";", "Cadastro", ".", "dao", ".", "UsuarioDAO", ".", "deletar", "(", "id", ")", ";", "}", "catch", "(", "SQLException", "exception", ")", "{", "System", ".", "out", ".", "println", "(", "\"Erro ao Deletar: \"", "+", "exception", ")", ";", "}", "}" ]
[ 124, 1 ]
[ 136, 2 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
TurmaController.
null
Metodo da janela de dialogo, para salvar os dados do turma
Metodo da janela de dialogo, para salvar os dados do turma
private void createDialogForm(Turma obj, String absoluteName, Stage parentStage) { try { FXMLLoader loader = new FXMLLoader(getClass().getResource(absoluteName)); Pane pane = loader.load(); //instancia um novo stage , criando um novo stage TurmaFormController controller = loader.getController(); controller.setTurma(obj); controller.setServices(new TurmaService(), new ProfessorService()); controller.loadAssociatedObjects(); controller.subscribeDataChangeListener(this);//Inscrevendo para receber o metodo onDataChange, obseervable list controller.updateFormData(); //Carrega a Turma no formulario Stage dialogStage = new Stage(); dialogStage.setTitle("Enter Turma data"); dialogStage.setScene(new Scene(pane)); dialogStage.setResizable(false); //Resizable: Diz se janela pode ser redimencionada dialogStage.initOwner(parentStage); dialogStage.initModality(Modality.WINDOW_MODAL);//Trava a janela dialogStage.showAndWait(); } catch (IOException e) { e.printStackTrace(); Alerts.showAlert("IO Exception", "Error loading view ", e.getMessage(), Alert.AlertType.ERROR); } }
[ "private", "void", "createDialogForm", "(", "Turma", "obj", ",", "String", "absoluteName", ",", "Stage", "parentStage", ")", "{", "try", "{", "FXMLLoader", "loader", "=", "new", "FXMLLoader", "(", "getClass", "(", ")", ".", "getResource", "(", "absoluteName", ")", ")", ";", "Pane", "pane", "=", "loader", ".", "load", "(", ")", ";", "//instancia um novo stage , criando um novo stage", "TurmaFormController", "controller", "=", "loader", ".", "getController", "(", ")", ";", "controller", ".", "setTurma", "(", "obj", ")", ";", "controller", ".", "setServices", "(", "new", "TurmaService", "(", ")", ",", "new", "ProfessorService", "(", ")", ")", ";", "controller", ".", "loadAssociatedObjects", "(", ")", ";", "controller", ".", "subscribeDataChangeListener", "(", "this", ")", ";", "//Inscrevendo para receber o metodo onDataChange, obseervable list", "controller", ".", "updateFormData", "(", ")", ";", "//Carrega a Turma no formulario", "Stage", "dialogStage", "=", "new", "Stage", "(", ")", ";", "dialogStage", ".", "setTitle", "(", "\"Enter Turma data\"", ")", ";", "dialogStage", ".", "setScene", "(", "new", "Scene", "(", "pane", ")", ")", ";", "dialogStage", ".", "setResizable", "(", "false", ")", ";", "//Resizable: Diz se janela pode ser redimencionada", "dialogStage", ".", "initOwner", "(", "parentStage", ")", ";", "dialogStage", ".", "initModality", "(", "Modality", ".", "WINDOW_MODAL", ")", ";", "//Trava a janela", "dialogStage", ".", "showAndWait", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "Alerts", ".", "showAlert", "(", "\"IO Exception\"", ",", "\"Error loading view \"", ",", "e", ".", "getMessage", "(", ")", ",", "Alert", ".", "AlertType", ".", "ERROR", ")", ";", "}", "}" ]
[ 143, 4 ]
[ 167, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Lote.
null
Faz a busca de uma vacina que nao foi aberta e depois retorna os dados da aplicacao
Faz a busca de uma vacina que nao foi aberta e depois retorna os dados da aplicacao
public Aplicacao usarVacina() { //Para cada vacina dentro do lote valido // Podia fazer o acesso por meio de indexacao for(Vacina vac: getVacinas()) { //Se a vacina nao possuir data de abertura if(vac.getAberto()!=null) { vac.abrirVacina(); removeVacinaFechada(); return new Aplicacao(vac,Utils.cadastroPessoa()); } } return null; }
[ "public", "Aplicacao", "usarVacina", "(", ")", "{", "//Para cada vacina dentro do lote valido", "// Podia fazer o acesso por meio de indexacao", "for", "(", "Vacina", "vac", ":", "getVacinas", "(", ")", ")", "{", "//Se a vacina nao possuir data de abertura ", "if", "(", "vac", ".", "getAberto", "(", ")", "!=", "null", ")", "{", "vac", ".", "abrirVacina", "(", ")", ";", "removeVacinaFechada", "(", ")", ";", "return", "new", "Aplicacao", "(", "vac", ",", "Utils", ".", "cadastroPessoa", "(", ")", ")", ";", "}", "}", "return", "null", ";", "}" ]
[ 92, 1 ]
[ 104, 2 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
SecurityConfig.
null
Este método faz parta da criptografia das senhas.
Este método faz parta da criptografia das senhas.
@Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(service).passwordEncoder(new BCryptPasswordEncoder()); }
[ "@", "Override", "protected", "void", "configure", "(", "AuthenticationManagerBuilder", "auth", ")", "throws", "Exception", "{", "auth", ".", "userDetailsService", "(", "service", ")", ".", "passwordEncoder", "(", "new", "BCryptPasswordEncoder", "(", ")", ")", ";", "}" ]
[ 44, 2 ]
[ 47, 3 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
ProfessorService.
null
Metodo para remover um Professor do banco de dados
Metodo para remover um Professor do banco de dados
public void remove(Professor obj){ dao.deleteById(obj.getIdnome()); }
[ "public", "void", "remove", "(", "Professor", "obj", ")", "{", "dao", ".", "deleteById", "(", "obj", ".", "getIdnome", "(", ")", ")", ";", "}" ]
[ 32, 4 ]
[ 34, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
EmprestimoService.
null
Regra de Negócio 3: Não podem ser emprestadas fitas com status disponível false
Regra de Negócio 3: Não podem ser emprestadas fitas com status disponível false
public boolean verificarRegrasDeNegocio(Emprestimo obj) { // Regra de Negócio 1: Cliente não pode ter multas não pagas Collection<Cliente> devedores = clienteRepository.findDevedores(); // boolean clienteDevedor = devedores.contains(obj.getCliente()); boolean clienteDevedor = false; for (Cliente devedor : devedores) { if (devedor.getId() == obj.getCliente().getId()) { clienteDevedor = true; } } if (clienteDevedor) { throw new BusinessRuleException("Este cliente deve multas anteriores!"); } // Regra de Negócio 2: Não podem ser emprestadas fitas reservadas para outros clientes boolean fitasReservadas = false; for (ItemDeEmprestimo item : obj.getItens()) { // Verificando se existem reservas em aberto para a fita Reserva reserva = reservaRepository.findByFitaAndStatus(item.getId().getFita().getId(), 0); if (reserva != null) { fitasReservadas = true; } } if (fitasReservadas) { throw new BusinessRuleException("Existem fitas com reservadas em aberto!"); } // Regra de Negócio 3: Não podem ser emprestadas fitas com status disponível false boolean fitasDisponiveis = true; for (ItemDeEmprestimo item : obj.getItens()) { // Verificando se existem fitas com status disponível false Fita fita = fitaRepository.findByIdAndDisponivel(item.getId().getFita().getId(), false); if (fita != null) { fitasDisponiveis = false; } } if (!fitasDisponiveis) { throw new BusinessRuleException("Existem fitas não disponíveis para empréstimo!"); } if (!clienteDevedor && !fitasReservadas && fitasDisponiveis) { return true; } else { return false; } }
[ "public", "boolean", "verificarRegrasDeNegocio", "(", "Emprestimo", "obj", ")", "{", "// Regra de Negócio 1: Cliente não pode ter multas não pagas", "Collection", "<", "Cliente", ">", "devedores", "=", "clienteRepository", ".", "findDevedores", "(", ")", ";", "// boolean clienteDevedor = devedores.contains(obj.getCliente());", "boolean", "clienteDevedor", "=", "false", ";", "for", "(", "Cliente", "devedor", ":", "devedores", ")", "{", "if", "(", "devedor", ".", "getId", "(", ")", "==", "obj", ".", "getCliente", "(", ")", ".", "getId", "(", ")", ")", "{", "clienteDevedor", "=", "true", ";", "}", "}", "if", "(", "clienteDevedor", ")", "{", "throw", "new", "BusinessRuleException", "(", "\"Este cliente deve multas anteriores!\"", ")", ";", "}", "// Regra de Negócio 2: Não podem ser emprestadas fitas reservadas para outros clientes", "boolean", "fitasReservadas", "=", "false", ";", "for", "(", "ItemDeEmprestimo", "item", ":", "obj", ".", "getItens", "(", ")", ")", "{", "// Verificando se existem reservas em aberto para a fita", "Reserva", "reserva", "=", "reservaRepository", ".", "findByFitaAndStatus", "(", "item", ".", "getId", "(", ")", ".", "getFita", "(", ")", ".", "getId", "(", ")", ",", "0", ")", ";", "if", "(", "reserva", "!=", "null", ")", "{", "fitasReservadas", "=", "true", ";", "}", "}", "if", "(", "fitasReservadas", ")", "{", "throw", "new", "BusinessRuleException", "(", "\"Existem fitas com reservadas em aberto!\"", ")", ";", "}", "// Regra de Negócio 3: Não podem ser emprestadas fitas com status disponível false", "boolean", "fitasDisponiveis", "=", "true", ";", "for", "(", "ItemDeEmprestimo", "item", ":", "obj", ".", "getItens", "(", ")", ")", "{", "// Verificando se existem fitas com status disponível false", "Fita", "fita", "=", "fitaRepository", ".", "findByIdAndDisponivel", "(", "item", ".", "getId", "(", ")", ".", "getFita", "(", ")", ".", "getId", "(", ")", ",", "false", ")", ";", "if", "(", "fita", "!=", "null", ")", "{", "fitasDisponiveis", "=", "false", ";", "}", "}", "if", "(", "!", "fitasDisponiveis", ")", "{", "throw", "new", "BusinessRuleException", "(", "\"Existem fitas não disponíveis para empréstimo!\");", "", "", "}", "if", "(", "!", "clienteDevedor", "&&", "!", "fitasReservadas", "&&", "fitasDisponiveis", ")", "{", "return", "true", ";", "}", "else", "{", "return", "false", ";", "}", "}" ]
[ 99, 1 ]
[ 145, 2 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Pagina.
null
Retorna o vetor de bytes que representa a página para armazenamento em arquivo
Retorna o vetor de bytes que representa a página para armazenamento em arquivo
protected byte[] getBytes() throws IOException { // Um fluxo de bytes é usado para construção do vetor de bytes ByteArrayOutputStream ba = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(ba); // Quantidade de elementos presentes na página out.writeInt(n); // Escreve todos os elementos int i=0; while(i<n) { out.writeLong(filhos[i]); out.write(completaBrancos(chaves[i])); out.writeInt(dados[i]); i++; } out.writeLong(filhos[i]); // Completa o restante da página com registros vazios byte[] registroVazio = new byte[TAMANHO_REGISTRO]; while(i<maxElementos){ out.write(registroVazio); out.writeLong(filhos[i+1]); i++; } // Escreve o ponteiro para a próxima página out.writeLong(proxima); // Retorna o vetor de bytes que representa a página return ba.toByteArray(); }
[ "protected", "byte", "[", "]", "getBytes", "(", ")", "throws", "IOException", "{", "// Um fluxo de bytes é usado para construção do vetor de bytes", "ByteArrayOutputStream", "ba", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "DataOutputStream", "out", "=", "new", "DataOutputStream", "(", "ba", ")", ";", "// Quantidade de elementos presentes na página", "out", ".", "writeInt", "(", "n", ")", ";", "// Escreve todos os elementos", "int", "i", "=", "0", ";", "while", "(", "i", "<", "n", ")", "{", "out", ".", "writeLong", "(", "filhos", "[", "i", "]", ")", ";", "out", ".", "write", "(", "completaBrancos", "(", "chaves", "[", "i", "]", ")", ")", ";", "out", ".", "writeInt", "(", "dados", "[", "i", "]", ")", ";", "i", "++", ";", "}", "out", ".", "writeLong", "(", "filhos", "[", "i", "]", ")", ";", "// Completa o restante da página com registros vazios", "byte", "[", "]", "registroVazio", "=", "new", "byte", "[", "TAMANHO_REGISTRO", "]", ";", "while", "(", "i", "<", "maxElementos", ")", "{", "out", ".", "write", "(", "registroVazio", ")", ";", "out", ".", "writeLong", "(", "filhos", "[", "i", "+", "1", "]", ")", ";", "i", "++", ";", "}", "// Escreve o ponteiro para a próxima página", "out", ".", "writeLong", "(", "proxima", ")", ";", "// Retorna o vetor de bytes que representa a página", "return", "ba", ".", "toByteArray", "(", ")", ";", "}" ]
[ 110, 8 ]
[ 142, 9 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Vendedor.
null
Converte a comissao base num valor de 1-100%
Converte a comissao base num valor de 1-100%
public double calculaSalario(){ return getSalarioBase() + (getSalarioBase() * (comissaoBase/100)); }
[ "public", "double", "calculaSalario", "(", ")", "{", "return", "getSalarioBase", "(", ")", "+", "(", "getSalarioBase", "(", ")", "*", "(", "comissaoBase", "/", "100", ")", ")", ";", "}" ]
[ 14, 4 ]
[ 16, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
TokenManager.
null
gera o token em função desse authentication
gera o token em função desse authentication
public String generateToken(Authentication authentication) { UserDetails user = (UserDetails) authentication.getPrincipal(); final Date now = new Date(); final Date expiration = new Date(now.getTime() + this.expirationInMillis); return Jwts.builder() .setIssuer("Desafio jornada dev eficiente mercado livre") .setSubject(user.getUsername()) .setIssuedAt(now) .setExpiration(expiration) .signWith(SignatureAlgorithm.HS256, this.secret) .compact(); }
[ "public", "String", "generateToken", "(", "Authentication", "authentication", ")", "{", "UserDetails", "user", "=", "(", "UserDetails", ")", "authentication", ".", "getPrincipal", "(", ")", ";", "final", "Date", "now", "=", "new", "Date", "(", ")", ";", "final", "Date", "expiration", "=", "new", "Date", "(", "now", ".", "getTime", "(", ")", "+", "this", ".", "expirationInMillis", ")", ";", "return", "Jwts", ".", "builder", "(", ")", ".", "setIssuer", "(", "\"Desafio jornada dev eficiente mercado livre\"", ")", ".", "setSubject", "(", "user", ".", "getUsername", "(", ")", ")", ".", "setIssuedAt", "(", "now", ")", ".", "setExpiration", "(", "expiration", ")", ".", "signWith", "(", "SignatureAlgorithm", ".", "HS256", ",", "this", ".", "secret", ")", ".", "compact", "(", ")", ";", "}" ]
[ 22, 4 ]
[ 36, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
MountainBike.
null
overriding o método toString() de Bicicleta, para escreve mais informações
overriding o método toString() de Bicicleta, para escreve mais informações
@Override public String toString() { return (super.toString() + "\n A alutura do assento é: " + altAssento + " cm"); }
[ "@", "Override", "public", "String", "toString", "(", ")", "{", "return", "(", "super", ".", "toString", "(", ")", "+", "\"\\n A alutura do assento é: \" ", " ", "ltAssento ", " ", " cm\")", ";", "", "}" ]
[ 65, 1 ]
[ 68, 2 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Data.
null
monta os meses no formato MES/ANO para a exibição no grafico
monta os meses no formato MES/ANO para a exibição no grafico
public static List<String> getCategoryMeses(int periodo, int mes) { String meses[] = { "Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Aug", "Set", "Out", "Nov", "Dez" }; Calendar c = Calendar.getInstance(); int ano = Data.getAno(c); List<String> categoryMeses = new ArrayList<>(); for (int i = 0; i <= periodo; i++) { categoryMeses.add(meses[mes - 1] + "/" + ano); if (mes == 12) { mes = 1; ano++; } else { mes++; } } return categoryMeses; }
[ "public", "static", "List", "<", "String", ">", "getCategoryMeses", "(", "int", "periodo", ",", "int", "mes", ")", "{", "String", "meses", "[", "]", "=", "{", "\"Jan\"", ",", "\"Fev\"", ",", "\"Mar\"", ",", "\"Abr\"", ",", "\"Mai\"", ",", "\"Jun\"", ",", "\"Jul\"", ",", "\"Aug\"", ",", "\"Set\"", ",", "\"Out\"", ",", "\"Nov\"", ",", "\"Dez\"", "}", ";", "Calendar", "c", "=", "Calendar", ".", "getInstance", "(", ")", ";", "int", "ano", "=", "Data", ".", "getAno", "(", "c", ")", ";", "List", "<", "String", ">", "categoryMeses", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "periodo", ";", "i", "++", ")", "{", "categoryMeses", ".", "add", "(", "meses", "[", "mes", "-", "1", "]", "+", "\"/\"", "+", "ano", ")", ";", "if", "(", "mes", "==", "12", ")", "{", "mes", "=", "1", ";", "ano", "++", ";", "}", "else", "{", "mes", "++", ";", "}", "}", "return", "categoryMeses", ";", "}" ]
[ 26, 1 ]
[ 41, 2 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
CalculadorDeClasses.
null
Retorna a soma dos valores dos campos para tipos BigDecimal
Retorna a soma dos valores dos campos para tipos BigDecimal
private BigDecimal sumAllValuesOfFields(Object o, List<Field> fieldsList) { BigDecimal sum = BigDecimal.ZERO; for (Field f: fieldsList){ BigDecimal valueField = BigDecimal.ZERO; if(f.getType().isAssignableFrom(BigDecimal.class)) //Checando se o campo é do tipo BigDecimal { try { f.setAccessible(true); //Tornando o campo acessível caso seja privado valueField = (BigDecimal) f.get(o); } catch (IllegalAccessException e) { e.printStackTrace(); } sum = sum.add(valueField); } } return sum; }
[ "private", "BigDecimal", "sumAllValuesOfFields", "(", "Object", "o", ",", "List", "<", "Field", ">", "fieldsList", ")", "{", "BigDecimal", "sum", "=", "BigDecimal", ".", "ZERO", ";", "for", "(", "Field", "f", ":", "fieldsList", ")", "{", "BigDecimal", "valueField", "=", "BigDecimal", ".", "ZERO", ";", "if", "(", "f", ".", "getType", "(", ")", ".", "isAssignableFrom", "(", "BigDecimal", ".", "class", ")", ")", "//Checando se o campo é do tipo BigDecimal", "{", "try", "{", "f", ".", "setAccessible", "(", "true", ")", ";", "//Tornando o campo acessível caso seja privado", "valueField", "=", "(", "BigDecimal", ")", "f", ".", "get", "(", "o", ")", ";", "}", "catch", "(", "IllegalAccessException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "sum", "=", "sum", ".", "add", "(", "valueField", ")", ";", "}", "}", "return", "sum", ";", "}" ]
[ 50, 4 ]
[ 66, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Canguru.
null
(Polimorfismo) sobrepondo com a mesma assinatura do método locomover da classe Mamifero
(Polimorfismo) sobrepondo com a mesma assinatura do método locomover da classe Mamifero
@Override public void locomover(){ System.out.println("Saltando"); }
[ "@", "Override", "public", "void", "locomover", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"Saltando\"", ")", ";", "}" ]
[ 11, 4 ]
[ 14, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
ProtocoloController.
null
Atualiza um protocolo
Atualiza um protocolo
@RequestMapping(value="/protocolo", method=RequestMethod.PUT) @ApiOperation(value="Atualiza um protocolo") public ResponseEntity<?> atualizaProtocolo(@RequestBody Protocolo protocolo) { Protocolo obj = protocoloService.atualizaProtocolo(protocolo); return ResponseEntity.ok().body(obj); }
[ "@", "RequestMapping", "(", "value", "=", "\"/protocolo\"", ",", "method", "=", "RequestMethod", ".", "PUT", ")", "@", "ApiOperation", "(", "value", "=", "\"Atualiza um protocolo\"", ")", "public", "ResponseEntity", "<", "?", ">", "atualizaProtocolo", "(", "@", "RequestBody", "Protocolo", "protocolo", ")", "{", "Protocolo", "obj", "=", "protocoloService", ".", "atualizaProtocolo", "(", "protocolo", ")", ";", "return", "ResponseEntity", ".", "ok", "(", ")", ".", "body", "(", "obj", ")", ";", "}" ]
[ 45, 1 ]
[ 50, 2 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
OperationService.
null
Verifica se as moedas de origem e destino existem no banco e calcula o valor final, com a cobrança de 10% de taxa
Verifica se as moedas de origem e destino existem no banco e calcula o valor final, com a cobrança de 10% de taxa
public Double finalValue(OperationPostRequestBody operationPostRequestBody){ // Pega a cotação da moeda de entrada e de saída no banco de dados. O valor da cotação das moedas no banco está em BRL Double priceQuoteCurrencyIn = currencyRepository.findById(operationPostRequestBody.getCurrencyIn()) .map(x -> x.getPriceQuote()) .orElse(9999999.99); Double priceQuoteCurrencyOut = currencyRepository.findById(operationPostRequestBody.getCurrencyOut()) .map(x -> x.getPriceQuote()) .orElse(9999999.99); // Verificação se a moeda existe no banco de dados. Se não existir, o código para aqui e nada é salvo if(priceQuoteCurrencyIn == 9999999.99 || priceQuoteCurrencyOut == 9999999.99){ return null; } // Se a moeda existir, ela será convertida da moeda de entrada para a moeda de saída aqui Double convertedValue = convertValue(operationPostRequestBody.getOriginalPrice(), priceQuoteCurrencyOut, priceQuoteCurrencyIn); Double finalValue = convertedValue - convertedValue * operationPostRequestBody.getServiceBill(); return finalValue; }
[ "public", "Double", "finalValue", "(", "OperationPostRequestBody", "operationPostRequestBody", ")", "{", "// Pega a cotação da moeda de entrada e de saída no banco de dados. O valor da cotação das moedas no banco está em BRL", "Double", "priceQuoteCurrencyIn", "=", "currencyRepository", ".", "findById", "(", "operationPostRequestBody", ".", "getCurrencyIn", "(", ")", ")", ".", "map", "(", "x", "->", "x", ".", "getPriceQuote", "(", ")", ")", ".", "orElse", "(", "9999999.99", ")", ";", "Double", "priceQuoteCurrencyOut", "=", "currencyRepository", ".", "findById", "(", "operationPostRequestBody", ".", "getCurrencyOut", "(", ")", ")", ".", "map", "(", "x", "->", "x", ".", "getPriceQuote", "(", ")", ")", ".", "orElse", "(", "9999999.99", ")", ";", "// Verificação se a moeda existe no banco de dados. Se não existir, o código para aqui e nada é salvo", "if", "(", "priceQuoteCurrencyIn", "==", "9999999.99", "||", "priceQuoteCurrencyOut", "==", "9999999.99", ")", "{", "return", "null", ";", "}", "// Se a moeda existir, ela será convertida da moeda de entrada para a moeda de saída aqui", "Double", "convertedValue", "=", "convertValue", "(", "operationPostRequestBody", ".", "getOriginalPrice", "(", ")", ",", "priceQuoteCurrencyOut", ",", "priceQuoteCurrencyIn", ")", ";", "Double", "finalValue", "=", "convertedValue", "-", "convertedValue", "*", "operationPostRequestBody", ".", "getServiceBill", "(", ")", ";", "return", "finalValue", ";", "}" ]
[ 40, 1 ]
[ 60, 2 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
aula02ex.
null
5. Área Rectangulo com lados de comprimento a e b
5. Área Rectangulo com lados de comprimento a e b
static int areaRect(int a, int b) { return a * b; }
[ "static", "int", "areaRect", "(", "int", "a", ",", "int", "b", ")", "{", "return", "a", "*", "b", ";", "}" ]
[ 65, 4 ]
[ 67, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Estacionamento.
null
Verifica se o carro e o motorista estão de acordo com as regras para que possa estacionar e caso estejam de acordo permite o carro ocupar uma vaga
Verifica se o carro e o motorista estão de acordo com as regras para que possa estacionar e caso estejam de acordo permite o carro ocupar uma vaga
public void estacionar(Carro carro) { if(carro.getMotorista() == null || carro.getMotorista().getIdade()<18 || carro.getMotorista().getPontos()>20) throw new EstacionamentoException("Não cumpre um dos requesitos para estacionar"); /* * O estacionamento não deverá comportar o número superior de vagas. * * Caso o estacionamento esteja lotado: * Chegue mais um novo carro, o primeiro que estacionou deverá sair * * Caso o motorista do primeiro carro estacionado tenha uma idade superior a 55 anos, será escolhido o próximo motorista abaixo dos 55 anos. * * Caso todos os motoristas, dentro do estacionamento, tenham mais de 55 anos e chegue um motorista, ele não conseguirá estacionar. */ else if(this.carrosEstacionados()>=10) { //Método 1 // this.estacionamento // .stream() // .forEach(j -> { // if(j.getMotorista().getIdade() <= 55){ // this.estacionamento.remove(j); //Pegar o index // return; // } // }); //Método 2 int i = 0; for (Carro c: this.estacionamento){ if(c.getMotorista().getIdade() <= 55) { this.estacionamento.remove(i); break; } i++; } if(this.estacionamento.size() == 9) this.estacionamento.add(carro); else throw new EstacionamentoException("Não há vagas. Todos os motoristas tem prioridade"); } else this.estacionamento.add(carro); }
[ "public", "void", "estacionar", "(", "Carro", "carro", ")", "{", "if", "(", "carro", ".", "getMotorista", "(", ")", "==", "null", "||", "carro", ".", "getMotorista", "(", ")", ".", "getIdade", "(", ")", "<", "18", "||", "carro", ".", "getMotorista", "(", ")", ".", "getPontos", "(", ")", ">", "20", ")", "throw", "new", "EstacionamentoException", "(", "\"Não cumpre um dos requesitos para estacionar\")", ";", "", "/*\n * O estacionamento não deverá comportar o número superior de vagas.\n * * Caso o estacionamento esteja lotado: * Chegue mais um novo carro, o primeiro que estacionou deverá sair\n * * Caso o motorista do primeiro carro estacionado tenha uma idade superior a 55 anos, será escolhido o próximo motorista abaixo dos 55 anos.\n * * Caso todos os motoristas, dentro do estacionamento, tenham mais de 55 anos e chegue um motorista, ele não conseguirá estacionar.\n */", "else", "if", "(", "this", ".", "carrosEstacionados", "(", ")", ">=", "10", ")", "{", "//Método 1", "// this.estacionamento", "// .stream()", "// .forEach(j -> {", "// if(j.getMotorista().getIdade() <= 55){", "// this.estacionamento.remove(j); //Pegar o index", "// return;", "// }", "// });", "//Método 2", "int", "i", "=", "0", ";", "for", "(", "Carro", "c", ":", "this", ".", "estacionamento", ")", "{", "if", "(", "c", ".", "getMotorista", "(", ")", ".", "getIdade", "(", ")", "<=", "55", ")", "{", "this", ".", "estacionamento", ".", "remove", "(", "i", ")", ";", "break", ";", "}", "i", "++", ";", "}", "if", "(", "this", ".", "estacionamento", ".", "size", "(", ")", "==", "9", ")", "this", ".", "estacionamento", ".", "add", "(", "carro", ")", ";", "else", "throw", "new", "EstacionamentoException", "(", "\"Não há vagas. Todos os motoristas tem prioridade\");", "", "", "}", "else", "this", ".", "estacionamento", ".", "add", "(", "carro", ")", ";", "}" ]
[ 10, 4 ]
[ 48, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Bicicleta.
null
Imprime informações sobre a bicicleta
Imprime informações sobre a bicicleta
public String toString() { return ("Tamanho do disco da bicicleta é: " + disco + " polegadas \n" + "e a velocidade é " + velocidade + "km/h"); }
[ "public", "String", "toString", "(", ")", "{", "return", "(", "\"Tamanho do disco da bicicleta é: \" ", " ", "isco ", " ", " polegadas \\n\" ", " ", "e a velocidade é \" +", "v", "locidade +", "\"", "m/h\");", "", "", "}" ]
[ 38, 1 ]
[ 41, 2 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
SecurityConfigurations.
null
Configurações de autenticação
Configurações de autenticação
@Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(autenticationService).passwordEncoder(new BCryptPasswordEncoder()); }
[ "@", "Override", "protected", "void", "configure", "(", "AuthenticationManagerBuilder", "auth", ")", "throws", "Exception", "{", "auth", ".", "userDetailsService", "(", "autenticationService", ")", ".", "passwordEncoder", "(", "new", "BCryptPasswordEncoder", "(", ")", ")", ";", "}" ]
[ 40, 1 ]
[ 43, 2 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Crud.
null
Metodo de criar novos objetos do Crud
Metodo de criar novos objetos do Crud
public int create(T objeto) { int id = -1; try { // Indo no inicio do arquivo pegar o metadado do ID arquivo.seek(0); id = arquivo.readInt(); } catch(IOException ioe) { ioe.printStackTrace(); } // Retornando a id usada na criacao do objeto if(id != -1) this.create(objeto, id); return id; }
[ "public", "int", "create", "(", "T", "objeto", ")", "{", "int", "id", "=", "-", "1", ";", "try", "{", "// Indo no inicio do arquivo pegar o metadado do ID", "arquivo", ".", "seek", "(", "0", ")", ";", "id", "=", "arquivo", ".", "readInt", "(", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "ioe", ".", "printStackTrace", "(", ")", ";", "}", "// Retornando a id usada na criacao do objeto", "if", "(", "id", "!=", "-", "1", ")", "this", ".", "create", "(", "objeto", ",", "id", ")", ";", "return", "id", ";", "}" ]
[ 57, 4 ]
[ 70, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Usuario.
null
Set nome do nome
Set nome do nome
public void setNome(String nome) { this.nome = nome; }
[ "public", "void", "setNome", "(", "String", "nome", ")", "{", "this", ".", "nome", "=", "nome", ";", "}" ]
[ 43, 4 ]
[ 45, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
NetworkToolkit.
null
Responsável por converter um InputStream para String
Responsável por converter um InputStream para String
private static String converterInputStreamToString(InputStream is) { StringBuffer buffer = new StringBuffer(); try{ BufferedReader br; String linha; br = new BufferedReader(new InputStreamReader(is)); while((linha = br.readLine())!=null){ buffer.append(linha); } br.close(); }catch(IOException e){ e.printStackTrace(); } return buffer.toString(); }
[ "private", "static", "String", "converterInputStreamToString", "(", "InputStream", "is", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "try", "{", "BufferedReader", "br", ";", "String", "linha", ";", "br", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "is", ")", ")", ";", "while", "(", "(", "linha", "=", "br", ".", "readLine", "(", ")", ")", "!=", "null", ")", "{", "buffer", ".", "append", "(", "linha", ")", ";", "}", "br", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "return", "buffer", ".", "toString", "(", ")", ";", "}" ]
[ 169, 8 ]
[ 186, 9 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
DesafioMeuTimeApplication.
null
Retorna o identificador do jogador mais velho do time. Usar o menor identificador como critério de desempate.
Retorna o identificador do jogador mais velho do time. Usar o menor identificador como critério de desempate.
@Desafio("buscarJogadorMaisVelho") public Long buscarJogadorMaisVelho(Long idTime) { //Caso o time informado não exista, retornar br.com.codenation.desafio.exceptions.TimeNaoEncontradoException Time t = this.buscaTimePeloId(idTime).orElseThrow(TimeNaoEncontradoException::new); //Critério de comparação //Comparator<Jogador> compararIdadeThenId = Comparator.comparing(Jogador::getDataNascimento).thenComparingLong(Jogador::getId); /*return t.getJogadores() .stream() .min(Comparator.comparing(Jogador::getDataNascimento) .thenComparingLong(Jogador::getId)) .get() .getId(); */ return t.getJogadores() .stream() .min(Comparator.comparing(Jogador::getDataNascimento) .thenComparing(Jogador::getId)) .map(Jogador::getId) .orElse(null); // return t.getJogadores() // .stream() // .sorted(Comparator.comparing(Jogador::getDataNascimento) // .thenComparing(Jogador::getId)) // .findFirst() // .get() // .getId(); }
[ "@", "Desafio", "(", "\"buscarJogadorMaisVelho\"", ")", "public", "Long", "buscarJogadorMaisVelho", "(", "Long", "idTime", ")", "{", "//Caso o time informado não exista, retornar br.com.codenation.desafio.exceptions.TimeNaoEncontradoException", "Time", "t", "=", "this", ".", "buscaTimePeloId", "(", "idTime", ")", ".", "orElseThrow", "(", "TimeNaoEncontradoException", "::", "new", ")", ";", "//Critério de comparação", "//Comparator<Jogador> compararIdadeThenId = Comparator.comparing(Jogador::getDataNascimento).thenComparingLong(Jogador::getId);", "/*return t.getJogadores()\n\t\t\t\t.stream()\n\t\t\t\t.min(Comparator.comparing(Jogador::getDataNascimento)\n\t\t\t\t\t\t.thenComparingLong(Jogador::getId))\n\t\t\t\t.get()\n\t\t\t\t.getId();\n\t\t*/", "return", "t", ".", "getJogadores", "(", ")", ".", "stream", "(", ")", ".", "min", "(", "Comparator", ".", "comparing", "(", "Jogador", "::", "getDataNascimento", ")", ".", "thenComparing", "(", "Jogador", "::", "getId", ")", ")", ".", "map", "(", "Jogador", "::", "getId", ")", ".", "orElse", "(", "null", ")", ";", "//\t\treturn t.getJogadores()", "//\t\t\t\t.stream()", "//\t\t\t\t.sorted(Comparator.comparing(Jogador::getDataNascimento)", "//\t\t\t\t.thenComparing(Jogador::getId))", "//\t\t\t\t.findFirst()", "//\t\t\t\t.get()", "//\t\t\t\t.getId();", "}" ]
[ 115, 1 ]
[ 146, 2 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
LBSTree.
null
Percorrer os nodos na arvore em pre-ordem
Percorrer os nodos na arvore em pre-ordem
protected void preOrder(LBSTreeNode treeRef) { if (treeRef != null) { treeString = treeString + "("; treeString = treeString + " " + treeRef.item + " "; preOrder(treeRef.linkLeft); preOrder(treeRef.linkRight); treeString = treeString + ")"; } }
[ "protected", "void", "preOrder", "(", "LBSTreeNode", "treeRef", ")", "{", "if", "(", "treeRef", "!=", "null", ")", "{", "treeString", "=", "treeString", "+", "\"(\"", ";", "treeString", "=", "treeString", "+", "\" \"", "+", "treeRef", ".", "item", "+", "\" \"", ";", "preOrder", "(", "treeRef", ".", "linkLeft", ")", ";", "preOrder", "(", "treeRef", ".", "linkRight", ")", ";", "treeString", "=", "treeString", "+", "\")\"", ";", "}", "}" ]
[ 153, 1 ]
[ 161, 2 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
DatabaseManager.
null
geralmente aqui podem ser criadas/recriadas as tabelas
geralmente aqui podem ser criadas/recriadas as tabelas
@Override public void onCreate(SQLiteDatabase sqLiteDatabase) { sqLiteDatabase.execSQL("DROP TABLE IF EXISTS CLIENTE"); sqLiteDatabase.execSQL("CREATE TABLE CLIENTE(\n" + "\tID_CLIENTE INT NOT NULL,\n" + "\tCPF VARCHAR(11) NOT NULL,\n" + "\tNOME VARCHAR(50) NOT NULL,\n" + "\tDATA_NASC VARCHAR(8),\n" + "\tPRIMARY KEY (ID_CLIENTE)\n" + ");"); }
[ "@", "Override", "public", "void", "onCreate", "(", "SQLiteDatabase", "sqLiteDatabase", ")", "{", "sqLiteDatabase", ".", "execSQL", "(", "\"DROP TABLE IF EXISTS CLIENTE\"", ")", ";", "sqLiteDatabase", ".", "execSQL", "(", "\"CREATE TABLE CLIENTE(\\n\"", "+", "\"\\tID_CLIENTE INT NOT NULL,\\n\"", "+", "\"\\tCPF VARCHAR(11) NOT NULL,\\n\"", "+", "\"\\tNOME VARCHAR(50) NOT NULL,\\n\"", "+", "\"\\tDATA_NASC VARCHAR(8),\\n\"", "+", "\"\\tPRIMARY KEY (ID_CLIENTE)\\n\"", "+", "\");\"", ")", ";", "}" ]
[ 18, 4 ]
[ 29, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
ListaDinamica.
null
Consultar o ultimo item da lista
Consultar o ultimo item da lista
public Object consultarFim() { if(!vazia()) return(fim.item); else return("Erro: lista vazia"); }
[ "public", "Object", "consultarFim", "(", ")", "{", "if", "(", "!", "vazia", "(", ")", ")", "return", "(", "fim", ".", "item", ")", ";", "else", "return", "(", "\"Erro: lista vazia\"", ")", ";", "}" ]
[ 185, 1 ]
[ 190, 2 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Cachorro.
null
sobre cargar tipo e quantidade diferentes
sobre cargar tipo e quantidade diferentes
public void reagir(String frase){ if("Toma Comida ".equals(frase) || "Ola".equals(frase)){ System.out.println("Abanar e Latir"); }else{ System.out.println("Rosnar"); } }
[ "public", "void", "reagir", "(", "String", "frase", ")", "{", "if", "(", "\"Toma Comida \"", ".", "equals", "(", "frase", ")", "||", "\"Ola\"", ".", "equals", "(", "frase", ")", ")", "{", "System", ".", "out", ".", "println", "(", "\"Abanar e Latir\"", ")", ";", "}", "else", "{", "System", ".", "out", ".", "println", "(", "\"Rosnar\"", ")", ";", "}", "}" ]
[ 18, 4 ]
[ 24, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Calculator.
null
Obter Historico parcial (Ultimas 3 Operações)
Obter Historico parcial (Ultimas 3 Operações)
public void getPartHistory(){ // Percorremos a array de forma inversa (do fim para o inicio) // mas só as ultimas 3 posições System.out.println("Ultimas 3 Operações registadas:"); for (int i=currentOps-1; i>=currentOps-3; i--){ System.out.println(historico[i]); } }
[ "public", "void", "getPartHistory", "(", ")", "{", "// Percorremos a array de forma inversa (do fim para o inicio)", "// mas só as ultimas 3 posições", "System", ".", "out", ".", "println", "(", "\"Ultimas 3 Operações registadas:\");", "", "", "for", "(", "int", "i", "=", "currentOps", "-", "1", ";", "i", ">=", "currentOps", "-", "3", ";", "i", "--", ")", "{", "System", ".", "out", ".", "println", "(", "historico", "[", "i", "]", ")", ";", "}", "}" ]
[ 49, 4 ]
[ 56, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
FXMLEntregaController.
null
Esse método mostra na tabela Dados o ID do pedido e nome do cliente relacionado àquele pedido
Esse método mostra na tabela Dados o ID do pedido e nome do cliente relacionado àquele pedido
public void carregarTableViewDados() { tabbleColumnPedidoId.setCellValueFactory(new PropertyValueFactory<>("id")); tabbleColumnCliente.setCellValueFactory(new PropertyValueFactory<>("nome")); listaPedido = pedidoService.listAll(); observableListPedido = FXCollections.observableArrayList(listaPedido); tabbleViewDados.setItems(observableListPedido); tabbleViewDados.refresh(); }
[ "public", "void", "carregarTableViewDados", "(", ")", "{", "tabbleColumnPedidoId", ".", "setCellValueFactory", "(", "new", "PropertyValueFactory", "<>", "(", "\"id\"", ")", ")", ";", "tabbleColumnCliente", ".", "setCellValueFactory", "(", "new", "PropertyValueFactory", "<>", "(", "\"nome\"", ")", ")", ";", "listaPedido", "=", "pedidoService", ".", "listAll", "(", ")", ";", "observableListPedido", "=", "FXCollections", ".", "observableArrayList", "(", "listaPedido", ")", ";", "tabbleViewDados", ".", "setItems", "(", "observableListPedido", ")", ";", "tabbleViewDados", ".", "refresh", "(", ")", ";", "}" ]
[ 113, 1 ]
[ 123, 2 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Menu.
null
Ler uma opção válida
Ler uma opção válida
private int readOption() { int op; //Scanner is = new Scanner(System.in); System.out.print("Opção: "); try { String line = is.nextLine(); op = Integer.parseInt(line); } catch (NumberFormatException e) { // Não foi inscrito um int op = -1; } if (op<0 || op>this.opcoes.size()) { System.out.println("\n*****************"); System.out.println("Opção Inválida!!!"); System.out.println("*****************"); op = -1; } return op; }
[ "private", "int", "readOption", "(", ")", "{", "int", "op", ";", "//Scanner is = new Scanner(System.in);\r", "System", ".", "out", ".", "print", "(", "\"Opção: \");", "\r", "", "try", "{", "String", "line", "=", "is", ".", "nextLine", "(", ")", ";", "op", "=", "Integer", ".", "parseInt", "(", "line", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "// Não foi inscrito um int\r", "op", "=", "-", "1", ";", "}", "if", "(", "op", "<", "0", "||", "op", ">", "this", ".", "opcoes", ".", "size", "(", ")", ")", "{", "System", ".", "out", ".", "println", "(", "\"\\n*****************\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"Opção Inválida!!!\");\r", "", "", "System", ".", "out", ".", "println", "(", "\"*****************\"", ")", ";", "op", "=", "-", "1", ";", "}", "return", "op", ";", "}" ]
[ 151, 4 ]
[ 170, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
OWMRequests.
null
Não é o jeito mais seguro de pedir a key, mas pelo menos ta encapsulado
Não é o jeito mais seguro de pedir a key, mas pelo menos ta encapsulado
public static String getAPI_KEY() { return API_KEY; }
[ "public", "static", "String", "getAPI_KEY", "(", ")", "{", "return", "API_KEY", ";", "}" ]
[ 35, 4 ]
[ 37, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration
Casa.
null
Obtem ArrayList de todos os Eletrodomesticos de uma divisao
Obtem ArrayList de todos os Eletrodomesticos de uma divisao
public ArrayList<Eletrodomestico> getDivisao(String divisao) { return mapaEletro.get(divisao); }
[ "public", "ArrayList", "<", "Eletrodomestico", ">", "getDivisao", "(", "String", "divisao", ")", "{", "return", "mapaEletro", ".", "get", "(", "divisao", ")", ";", "}" ]
[ 26, 4 ]
[ 28, 5 ]
null
java
pt
['pt', 'pt', 'pt']
True
true
method_declaration