Unnamed: 0
int64
0
9.45k
cwe_id
stringclasses
1 value
source
stringlengths
37
2.53k
target
stringlengths
19
2.4k
500
public void testGetResultsTimedWait() throws Exception{ final TopEntriesFunctionCollector collector = new TopEntriesFunctionCollector(); collector.addResult(null, result1); collector.addResult(null, result2); final CountDownLatch insideThread = new CountDownLatch(1); final CountDownLatch result...
public void testGetResultsTimedWait() throws Exception{ final TopEntriesFunctionCollector collector = new TopEntriesFunctionCollector(); collector.addResult(null, result1); collector.addResult(null, result2); TopEntries merged = collector.getResult(1, TimeUnit.SECONDS); assertEquals(4, merged.s...
501
private static void triggerJenkinsJob(String token) throws IOException{ URL url = new URL(remoteUrl + token); String user = "salahin"; String pass = "11d062d7023e11765b4d8ee867b67904f9"; String authStr = user + ":" + pass; String basicAuth = "Basic " + Base64.getEncoder().encodeToString(authStr...
private void triggerJenkinsJob(URL url) throws IOException{ String authStr = userId + ":" + jenkinsToken; String basicAuth = "Basic " + Base64.getEncoder().encodeToString(authStr.getBytes("utf-8")); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestPropert...
502
public void testModifyModifers2() throws ParseException{ String code = "public class B {\n public String foo;\n}"; DefaultJavaParser parser = new DefaultJavaParser(); CompilationUnit cu = parser.parse(code, false); CompilationUnit cu2 = parser.parse(code, false); FieldDeclaration md = (Field...
public void testModifyModifers2() throws ParseException{ String code = "public class B {\n public String foo;\n}"; DefaultJavaParser parser = new DefaultJavaParser(); CompilationUnit cu = parser.parse(code, false); CompilationUnit cu2 = parser.parse(code, false); FieldDeclaration md = (Field...
503
private Object executeHttpPost(String url, JSONObject data){ Object response = null; Log.d(tag, "executeHttpPost, url: " + url + ", data" + data); try { DefaultHttpClient httpclient = new DefaultHttpClient(); HttpPost httpost = new HttpPost(url); StringEntity se = new StringEnt...
private Object executeHttpPost(String url, JSONObject data){ Object response = null; Log.d(tag, "executeHttpPost, url: " + url + ", data" + data); try { DefaultHttpClient httpclient = new DefaultHttpClient(); HttpPost httpost = new HttpPost(url); StringEntity se = new StringEnt...
504
public void createProposalsForTemplateList(final List<ENodeTemplate> templates, final String defaultImage, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor){ for (final ENodeTemplate template : templates) { { String _xifexpression = null; String _mod...
public void createProposalsForTemplateList(final List<ENodeTemplate> templates, final String defaultImage, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor){ for (final ENodeTemplate template : templates) { { final String module = AADMHelper.getModule(template); ...
505
public Services get(String objectId){ Log.d(TAG, "get: Started..."); parseObject = null; ParseQuery<ParseObject> query = ParseQuery.getQuery(PARSECLASS.SERVICES.toString()); Services services = new Services(); try { Log.d(TAG, "get: Retrieving object..."); parseObject = query....
public Services get(String objectId){ parseObject = null; ParseQuery<ParseObject> query = ParseQuery.getQuery(PARSECLASS.SERVICES.toString()); Services services = new Services(); try { parseObject = query.get(objectId); services.setObjectId(parseObject.getObjectId()); serv...
506
void should_return_fizzbuzz_when_count_off_given_35(){ FizzBuzz fizzBuzz = new FizzBuzz(); int inputNumber = 35; String result = fizzBuzz.play(inputNumber); assertEquals("FizzBuzz", result); }
void should_return_fizzbuzz_when_count_off_given_35(){ int inputNumber = 35; String result = fizzBuzz.play(inputNumber); assertEquals("FizzBuzz", result); }
507
public JAXBElement<KoodiType> getKoodiByUri(@ApiParam(value = "Koodiston URI") @PathParam(KOODISTO_URI) String koodistoUri, @ApiParam(value = "Koodin URI") @PathParam(KOODI_URI) String koodiUri, @ApiParam(value = "Koodiston versio") @QueryParam(KOODISTO_VERSIO) Integer koodistoVersio){ KoodiVersioWithKoodistoItem ...
public JAXBElement<KoodiType> getKoodiByUri(@ApiParam(value = "Koodiston URI") @PathParam(KOODISTO_URI) String koodistoUri, @ApiParam(value = "Koodin URI") @PathParam(KOODI_URI) String koodiUri, @ApiParam(value = "Koodiston versio") @QueryParam(KOODISTO_VERSIO) Integer koodistoVersio){ KoodiVersioWithKoodistoItem ...
508
private static List<String> getTextLines(@NonNull Context ctx){ if (checkForText(ctx)) { ClipData.Item item = clipboard.getPrimaryClip().getItemAt(0); CharSequence cs = item.getText(); if (cs == null) { Uri pasteUri = item.getUri(); if (pasteUri != null) { ...
private static List<String> getTextLines(@NonNull Context ctx){ if (checkForText(ctx)) { ClipData.Item item = clipboard.getPrimaryClip().getItemAt(0); CharSequence cs = item.getText(); if (cs == null) { Uri pasteUri = item.getUri(); if (pasteUri != null) { ...
509
public static void CompareImagesTest() throws IOException{ baseTest bs = new baseTest(); bs.intialize(); driver = baseTest.getDriver(); try { driver.get("https://cinchhs-agent-accp.mendixcloud.com/login.html"); WebElement logo = driver.findElement(By.xpath("//div[@class='loginpage-...
public static void CompareImagesTest() throws IOException{ baseTest bs = new baseTest(); bs.intialize(); driver = baseTest.getDriver(); try { driver.get("https://cinchhs-agent-accp.mendixcloud.com/login.html"); WebElement logo = driver.findElement(By.xpath("//div[@class='loginpage-...
510
public Result viewTree(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam("processInstanceId") Integer processInstanceId) throws Exception{ Map<String, Object> result =...
public Result<GanttDto> viewTree(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam("processInstanceId") Integer processInstanceId) throws Exception{ return processInst...
511
public void open(HadoopInputSplit split) throws IOException{ synchronized (OPEN_MUTEX) { TaskAttemptContext context; try { context = HadoopUtils.instantiateTaskAttemptContext(configuration, new TaskAttemptID()); } catch (Exception e) { throw new RuntimeException...
public void open(HadoopInputSplit split) throws IOException{ synchronized (OPEN_MUTEX) { TaskAttemptContext context = new TaskAttemptContextImpl(configuration, new TaskAttemptID()); try { this.recordReader = this.mapreduceInputFormat.createRecordReader(split.getHadoopInputSplit(), co...
512
public Vector<ParameterDescription> getControls(){ Vector<ParameterDescription> v = super.getControls(); ParameterDescription pd = new ParameterDescription(); pd = new ParameterDescription(); pd.parameter = Boolean.valueOf(arrowData.isArrowStart()); pd.description = Globals.messages.getString("...
public Vector<ParameterDescription> getControls(){ Vector<ParameterDescription> v = super.getControls(); arrowData.getControlsForArrow(v); ParameterDescription pd = new ParameterDescription(); pd = new ParameterDescription(); pd.parameter = new DashInfo(dashStyle); pd.description = Globals...
513
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_setup_encryption_keys); if (getIntent().hasExtra("user")) { user = (User) getIntent().getExtras().get("user"); password = getIntent().getExtras().getString("password"...
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_setup_encryption_keys); if (getIntent().hasExtra("user")) { user = (User) getIntent().getExtras().get("user"); password = getIntent().getExtras().getString("password"...
514
private Boolean shouldShowHistory(final User thisUser, final PasswordBase thisPassword) throws SQLException{ UserClassifier userClassifier = new UserClassifier(); if (AccessRoleDAO.getInstance().hasRole(thisUser.getUserId(), thisPassword.getId(), AccessRole.HISTORYVIEWER_ROLE) || userClassifier.isAdministrato...
private Boolean shouldShowHistory(final User thisUser, final PasswordBase thisPassword) throws SQLException{ if (AccessRoleDAO.getInstance().hasRole(thisUser.getUserId(), thisPassword.getId(), AccessRole.HISTORYVIEWER_ROLE) || userClassifier.isAdministrator(thisUser)) { return Boolean.TRUE; } if...
515
public void testVerifyFailedLocalcase(String localValue) throws Exception{ hm = new HashMap<String, String>(); hm.put("partner_secret", getPropertyFromConfigFile("partner_secret")); hm.put("partner_id", getPropertyFromConfigFile("partner_id")); hm.put("q", getPropertyFromConfigFile("query")); h...
public void testVerifyFailedLocalcase(String localValue) throws Exception{ hm = new HashMap<String, String>(); hm.put("partner_secret", getPropertyFromConfigFile("partner_secret")); hm.put("partner_id", getPropertyFromConfigFile("partner_id")); hm.put("q", getPropertyFromConfigFile("query")); h...
516
public static Connection createConnectionIC(String nameLookUp){ UtilLogger.info(UtilsDatabase.class, "Trying a connection create"); try { InitialContext initialContext = new InitialContext(); DataSource dataSource = (DataSource) initialContext.lookup(nameLookUp); Connection connecti...
public static Connection createConnectionIC(String nameLookUp){ try { InitialContext initialContext = new InitialContext(); DataSource dataSource = (DataSource) initialContext.lookup(nameLookUp); Connection connection = dataSource.getConnection(); return connection; } catch...
517
public static String convert(int number){ String roman = ""; if (number == 0) { return ""; } else if (number == 5) { return "V"; } else if (number == 6) { return "VI"; } else if (number == 7) { return "VII"; } for (int i = 0; i < number; i++) { ...
public static String convert(int number){ String roman = ""; if (number >= 5) { number -= 5; roman += "V"; } for (int i = 0; i < number; i++) { roman += "I"; } return roman; }
518
public HashMap<String, List<String>> readLogicalDeps(String logicalDep){ HashMap<String, List<String>> storage = new HashMap<String, List<String>>(); BufferedReader br = null; String line = ""; String cvsSplitBy = ","; try { br = new BufferedReader(new FileReader(logicalDep)); ...
public Map<String, List<String>> readLogicalDeps(String logicalDep){ Map<String, List<String>> storage = new HashMap<>(); String line = ""; String cvsSplitBy = ","; try (BufferedReader br = new BufferedReader(new FileReader(logicalDep))) { br.readLine(); while ((line = br.readLine(...
519
public void execute(){ RSInterface chatInterface = Interfaces.get(263, 1, 0); if (InterfaceHandler.interfaceContainsText(chatInterface, "To make dough you must mix flour with water.")) { InventoryHandler.clickOnInventoryItem("Pot of flour"); InventoryHandler.clickOnInventoryItem("Bucket of w...
public void execute(){ RSInterface chatInterface = Interfaces.get(263, 1, 0); if (InterfaceHandler.interfaceContainsText(chatInterface, "To make dough you must mix flour with water.")) { InventoryHandler.clickOnInventoryItem("Pot of flour"); InventoryHandler.clickOnInventoryItem("Bucket of w...
520
public void clickFeaturesAmenities() throws Exception{ WebDriverFacade webDriverFacade = (WebDriverFacade) getDriver(); WebDriver webDriver = webDriverFacade.getProxiedDriver(); AppiumDriver appiumDriver = (AppiumDriver) webDriver; if (Config.isAndroid()) { Helper.swipeVerticalAndroid(appiu...
public void clickFeaturesAmenities() throws Exception{ if (Config.isAndroid()) { Helper.androidSwipeDownUntilElementVisible(featuresAmenities); } else { Helper.swipeDownUntilElementVisible(featuresAmenities); } element(featuresAmenities).click(); }
521
public Map<String, Object> createProject(User loginUser, String name, String desc){ Map<String, Object> result = new HashMap<>(); Map<String, Object> descCheck = checkDesc(desc); if (descCheck.get(Constants.STATUS) != Status.SUCCESS) { return descCheck; } Project project = projectMappe...
public Result<Integer> createProject(User loginUser, String name, String desc){ CheckParamResult descCheckResult = checkDesc(desc); if (!Status.SUCCESS.equals(descCheckResult.getStatus())) { return Result.error(descCheckResult); } Project project = projectMapper.queryByName(name); if (...
522
public Repository open(C req, String name) throws RepositoryNotFoundException, ServiceNotEnabledException{ if (isUnreasonableName(name)) throw new RepositoryNotFoundException(name); Repository db = exports.get(nameWithDotGit(name)); if (db != null) { db.incrementOpen(); return ...
public Repository open(C req, String name) throws RepositoryNotFoundException, ServiceNotEnabledException{ if (isUnreasonableName(name)) throw new RepositoryNotFoundException(name); Repository db = exports.get(nameWithDotGit(name)); if (db != null) { db.incrementOpen(); return ...
523
public int loadCensusData(String csvFilePath){ try { Reader reader = Files.newBufferedReader(Paths.get(csvFilePath)); Iterator<IndiaCensusCSV> censusCSVIterator = getCSVFileIterator(reader, IndiaCensusCSV.class); Iterable<IndiaCensusCSV> csvIterable = () -> censusCSVIterator; re...
public int loadCensusData(String csvFilePath){ try { Reader reader = Files.newBufferedReader(Paths.get(csvFilePath)); Iterator<IndiaStateCode> censusCSVIterator = new OpenCSVBuilder().getCSVFileIterator(reader, IndiaStateCode.class); return getCount(censusCSVIterator); } catch (IOEx...
524
public synchronized boolean delete(UUID id) throws Exception{ Preconditions.checkArgument(id != null, "UUID mustn't be null"); List<Cucc> cuccok = objectMapper.readValue(new File(REPO_PATH), new TypeReference<List<Cucc>>() { }); boolean deleted = false; for (int i = 0; i < cuccok.size(); i++) {...
public synchronized boolean delete(UUID id) throws Exception{ Preconditions.checkArgument(id != null, "UUID mustn't be null"); List<Cucc> cuccok = readRepo(); boolean deleted = false; for (int i = 0; i < cuccok.size(); i++) { if (id.equals(cuccok.get(i).id)) { cuccok.remove(i);...
525
public void run(){ if (Sesnor2Data == true) { Sesnor2Data = false; } else if (Sesnor2Data == false) { Sesnor2Data = true; } sensorStates.setLaserSensor2data(Sesnor2Data); System.out.println("fahim sesnor from laser2 = " + sensorStates.isLaserSensor2data()); changed(); }
public void run(){ if (Sesnor2Data == true) { Sesnor2Data = false; } else if (Sesnor2Data == false) { Sesnor2Data = true; } sensorStates.setLaserSensor2data(Sesnor2Data); changed(); }
526
public Result createUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userName") String userName, @RequestParam(value = "userPassword") String userPassword, @RequestParam(value = "tenantId") int tenantId, @RequestParam(value = "queue", required = false, defaultValu...
public Result<Void> createUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userName") String userName, @RequestParam(value = "userPassword") String userPassword, @RequestParam(value = "tenantId") int tenantId, @RequestParam(value = "queue", required = false, defau...
527
private Entry examineClassFile(File file){ if (file.length() > Integer.MAX_VALUE) { logger.fine("Skipping file " + file.getAbsolutePath() + " as the file size is > Integer.MAX_VALUE"); return null; } Entry entry = getEntry(file); if ((entry == null) || (entry.getData() == null) || ...
private Entry examineClassFile(File file){ if (file.length() > Integer.MAX_VALUE) { logger.fine("Skipping file " + file.getAbsolutePath() + " as the file size is > Integer.MAX_VALUE"); return null; } Entry entry = getEntry(file); if ((entry == null) || (entry.getData() == null) || ...
528
private String timeToString(double t){ double days = Math.floor(t / 86400); double hours = Math.floor((t % 86400) / 3600); double minutes = Math.floor(((t % 86400) % 3600) / 60); double seconds = Math.floor(((t % 86400) % 3600) % 60); String x = String.format("%6.0f days %6.0f hours %6.0f mins ...
private String timeToString(double t){ double days = Math.floor(t / 86400); double hours = Math.floor((t % 86400) / 3600); double minutes = Math.floor(((t % 86400) % 3600) / 60); double seconds = Math.floor(((t % 86400) % 3600) % 60); return String.format("%6.0f days %6.0f hours %6.0f mins %6.0...
529
public void batchExportProcessDefinitionByIds(User loginUser, String projectName, String processDefinitionIds, HttpServletResponse response){ if (StringUtils.isEmpty(processDefinitionIds)) { return; } Project project = projectMapper.queryByName(projectName); Map<String, Object> checkResult ...
public void batchExportProcessDefinitionByIds(User loginUser, String projectName, String processDefinitionIds, HttpServletResponse response){ if (StringUtils.isEmpty(processDefinitionIds)) { return; } Project project = projectMapper.queryByName(projectName); CheckParamResult checkResult = p...
530
public ClientPolicyBuilder createPolicy(String name, String description, Boolean isBuiltin, Boolean isEnabled, List<Object> conditions, List<String> profiles){ policyRep.setName(name); if (description != null) { policyRep.setDescription(description); } if (isBuiltin != null) { poli...
public ClientPolicyBuilder createPolicy(String name, String description, Boolean isBuiltin, Boolean isEnabled){ policyRep.setName(name); if (description != null) { policyRep.setDescription(description); } if (isBuiltin != null) { policyRep.setBuiltin(isBuiltin); } else { ...
531
public MessageAnnotations[] readArrayElements(ProtonBuffer buffer, DecoderState state, int count) throws DecodeException{ TypeDecoder<?> decoder = state.getDecoder().readNextTypeDecoder(buffer, state); MessageAnnotations[] result = new MessageAnnotations[count]; if (decoder instanceof NullTypeDecoder) { ...
public MessageAnnotations[] readArrayElements(ProtonBuffer buffer, DecoderState state, int count) throws DecodeException{ final TypeDecoder<?> decoder = state.getDecoder().readNextTypeDecoder(buffer, state); final MessageAnnotations[] result = new MessageAnnotations[count]; if (decoder instanceof NullTyp...
532
public void handleStructure(DatabaseStructure structure) throws ModuleException{ this.structure = structure; this.viewerDatabase = ToolkitStructure2ViewerStructure.getDatabase(structure, preSetDatabaseUUID); if (System.getProperty("env", "server").equals(ViewerConstants.SERVER)) { viewerDatabase...
public void handleStructure(DatabaseStructure structure) throws ModuleException{ this.structure = structure; this.viewerDatabase = ToolkitStructure2ViewerStructure.getDatabase(structure, preSetDatabaseUUID); solrManager.addDatabaseRowCollection(viewerDatabase); }
533
public int buyProduct(@AuthenticationPrincipal Object user, @RequestParam String id){ int productId = Integer.parseInt(id); cartService.addProduct(user, productId); Cart cart = userService.getUserCart(user); int totalProducts = cart.getTotalProducts(); return totalProducts; }
public int buyProduct(@AuthenticationPrincipal Object user, @RequestParam String id){ cartService.addProduct(user, Integer.parseInt(id)); return userService.getUserCart(user).getTotalProducts(); }
534
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_algorithmics); inputDigitTextView = findViewById(R.id.inputDigitTextView); sumEditText = findViewById(R.id.sumEditText); inputStringView = findViewById(R.id.inputStringView);...
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_algorithmics); inputDigitTextView = findViewById(R.id.input_digit_text_view); sumEditText = findViewById(R.id.sum_edit_text); inputStringView = findViewById(R.id.input_string...
535
protected Customer getNewModel(){ System.out.print("Input customer name: "); String customerName = new Scanner(System.in).nextLine(); Customer customer = new Customer(-100, customerName); return customer; }
protected Customer getNewModel(){ System.out.print("Input customer name: "); String customerName = new Scanner(System.in).nextLine(); return new Customer(-100, customerName); }
536
public ConnectorPageSource createPageSource(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorSplit split, ConnectorTableHandle tableHandle, List<ColumnHandle> columns, TupleDomain<ColumnHandle> dynamicFilter){ requireNonNull(split, "split is null"); PinotSplit pinotSplit = (Pin...
public ConnectorPageSource createPageSource(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorSplit split, ConnectorTableHandle tableHandle, List<ColumnHandle> columns, TupleDomain<ColumnHandle> dynamicFilter){ requireNonNull(split, "split is null"); PinotSplit pinotSplit = (Pin...
537
protected Expression translate(PGoTLASetOp tla) throws PGoTransException{ Expression leftRes = new TLAExprToGo(tla.getLeft(), imports, data, assign).toExpression(); Expression rightRes = new TLAExprToGo(tla.getRight(), imports, data, assign).toExpression(); Vector<Expression> lhs = new Vector<>(); l...
protected Expression translate(PGoTLASetOp tla) throws PGoTransException{ Expression leftRes = new TLAExprToGo(tla.getLeft(), imports, data, assign).toExpression(); Expression rightRes = new TLAExprToGo(tla.getRight(), imports, data, assign).toExpression(); Vector<Expression> lhs = new Vector<>(); l...
538
public RegisterAccountForm setRandomCity(){ String aCity = cities().capitals().get(); setCity(aCity); return this; }
public RegisterAccountForm setRandomCity(){ return setCity(cities().capitals().get()); }
539
void handleLocation(Location location, String provider){ if (mCurrentBestLocation != null && (mCurrentBestLocation.getTime() == location.getTime())) { logLocation(location, "Location is the same location that currentBestLocation"); return; } String message; long timeDelta = HALF_M...
void handleLocation(Location location, String provider){ if (mCurrentBestLocation != null && (mCurrentBestLocation.getTime() == location.getTime())) { logLocation(location, "Location is the same location that currentBestLocation"); return; } String message; long timeDelta = HALF_M...
540
public Collection<Edge> getEdges(){ Collection<Edge> set = new HashSet<>(); int n = graph.length; for (int i = 0; i < n; i++) { set.addAll(graph[i]); } return set; }
public Collection<Edge> getEdges(){ Collection<Edge> set = new HashSet<>(); for (LinkedList<Edge> edges : graph) { set.addAll(edges); } return set; }
541
private void createIndex(NodeDetail nodeDetail, boolean processWysiwygContent){ Objects.requireNonNull(nodeDetail); final FullIndexEntry indexEntry = new FullIndexEntry(nodeDetail.getNodePK().getComponentName(), "Node", nodeDetail.getNodePK().getId()); final Collection<String> languages = nodeDetail.getL...
private void createIndex(NodeDetail nodeDetail, boolean processWysiwygContent){ Objects.requireNonNull(nodeDetail); final FullIndexEntry indexEntry = new FullIndexEntry(nodeDetail.getNodePK().getComponentName(), "Node", nodeDetail.getNodePK().getId()); final Collection<String> languages = nodeDetail.getL...
542
public int getHash32Value(String document){ byte[] buffer = document.getBytes(Charset.forName("utf-8")); System.out.println(buffer.length); return hash32(buffer, buffer.length, 0); }
public int getHash32Value(String document){ byte[] buffer = document.getBytes(Charset.forName("utf-8")); return hash32(buffer, buffer.length, 0); }
543
public static JPanel createEmotionsPanel(){ JPanel emotionsPanel = new JPanel(); emotionsPanel.setBorder(new TitledBorder(null, "Emotions", TitledBorder.LEADING, TitledBorder.TOP, SUBFONT, null)); Dimension spinnerDimension = new Dimension(65, 30); Double current = new Double(0.00); Double min ...
public static JPanel createEmotionsPanel(){ EmotionsView emotionsView = new EmotionsView(); return emotionsView.getEmotionsPanel(); }
544
public long updatePlay(long id, Play play, String authorizationBearer) throws Exception{ try { long authenticatedId = AuthenticationFilter.getAuthIdFromBearer(authorizationBearer); if (authenticatedId != play.getUserCreator().getId()) throw new SecurityException(USER_UNAUTHORIZED_MSG...
public void updatePlay(long id, Play play, String authorizationBearer) throws Exception{ try { long authenticatedId = AuthenticationFilter.getAuthIdFromBearer(authorizationBearer); if (authenticatedId != play.getUserCreator().getId()) throw new SecurityException(USER_UNAUTHORIZED_MSG...
545
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException{ try { Class.forName("com.mysql.jdbc.Driver"); Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/happy_hrs_db", "root", "mysql@1234"); String sql = "...
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException{ try { Connection connection = AppDBConnection.getConnection(); String sql = "select aid,username,password,name,email,gender,photo,doe,role from profiles_tbl"; PreparedStatement ...
546
private OutputAlleleSubset calculateOutputAlleleSubset(final AFCalculationResult afCalculationResult){ final List<Allele> alleles = afCalculationResult.getAllelesUsedInGenotyping(); final int alternativeAlleleCount = alleles.size() - 1; final Allele[] outputAlleles = new Allele[alternativeAlleleCount]; ...
private OutputAlleleSubset calculateOutputAlleleSubset(final AFCalculationResult afCalculationResult){ final List<Allele> outputAlleles = new ArrayList<>(); final List<Integer> mleCounts = new ArrayList<>(); boolean siteIsMonomorphic = true; for (final Allele alternativeAllele : afCalculationResult....
547
public String deleteUsersByUserGroup(@RequestParam Long group, @RequestParam Long user) throws RestWebApplicationException{ Boolean isOK = false; try { if (user == null) isOK = groupManager.removeCredentialGroup(group); else isOK = securityManager.deleteUserFromCred...
public String deleteUsersByUserGroup(@RequestParam Long group, @RequestParam Long user){ if (user == null) groupManager.removeCredentialGroup(group); else securityManager.deleteUserFromCredentialGroup(user, group); return "Deleted"; }
548
public ModelAndView process(ModelAndView mav, Locale locale){ mav.setViewName("memoryleak"); mav.addObject("title", msg.getMessage("title.heap.memory.usage", null, locale)); mav.addObject("note", msg.getMessage("msg.java.heap.space.leak.occur", null, locale)); try { toDoRemove(); L...
public ModelAndView process(ModelAndView mav, Locale locale){ mav.setViewName("memoryleak"); mav.addObject("title", msg.getMessage("title.heap.memory.usage", null, locale)); mav.addObject("note", msg.getMessage("msg.java.heap.space.leak.occur", null, locale)); toDoRemove(); List<MemoryPoolMXBea...
549
public void addRoleToUser(Long userId, Long projectID, UserRole role){ UserEntity user = userRepository.findById(userId); if (user.getRoles().get(projectID) == null || user.getRoles().get(projectID).length == 0) { String[] newRole = { role.toString() }; user.getRoles().put(projectID, newRole...
public void addRoleToUser(Long userId, Long projectID, UserRole role){ UserEntity user = userRepository.findById(userId); if (user.getRoles().get(projectID) == null || user.getRoles().get(projectID).size() == 0) { user.getRoles().put(projectID, new ArrayList<>(Collections.singleton(role.toString())))...
550
public boolean updateRelyingPartyServiceProvider(SAMLSSOServiceProviderDTO serviceProviderDTO) throws IdentityException{ SAMLSSOServiceProviderDO serviceProviderDO = createSAMLSSOServiceProviderDO(serviceProviderDTO); IdentityPersistenceManager persistenceManager = IdentityPersistenceManager.getPersistanceMan...
public boolean updateRelyingPartyServiceProvider(SAMLSSOServiceProviderDTO serviceProviderDTO) throws IdentityException{ SAMLSSOServiceProviderDO serviceProviderDO = createSAMLSSOServiceProviderDO(serviceProviderDTO); IdentityPersistenceManager persistenceManager = IdentityPersistenceManager.getPersistanceMan...
551
public String addTopic(@RequestBody Topic topic){ topicService.addTopic(topic); return "add done"; }
public ResponseDTO addTopic(@RequestBody Topic topic){ return topicService.addTopic(topic); }
552
public void testRangeWriteAfterPrefixTrim() throws Exception{ ServerContext sc = getContext(); StreamLog log = new StreamLogFiles(sc, false); final long trimMark = 1000; final long trimOverlap = 100; final long numEntries = 200; log.prefixTrim(trimMark); List<LogData> entries = new Ar...
public void testRangeWriteAfterPrefixTrim() throws Exception{ StreamLogFiles log = new StreamLogFiles(sc.getStreamLogParams(), sc.getStreamLogDataStore()); final long trimMark = 1000; final long trimOverlap = 100; final long numEntries = 200; log.prefixTrim(trimMark); List<LogData> entries...
553
public void call(Integer numTimes, QuaternionFloat64MatrixMember a, QuaternionFloat64MatrixMember b){ QuaternionFloat64Member factor = new QuaternionFloat64Member(0.5, 0, 0, 0); QuaternionFloat64MatrixMember prod = G.QDBL_MAT.construct(a); for (int i = 0; i < numTimes; i++) { scale().call(factor...
public void call(Integer numTimes, QuaternionFloat64MatrixMember a, QuaternionFloat64MatrixMember b){ ScaleHelper.compute(G.QDBL_MAT, G.QDBL, new QuaternionFloat64Member(0.5, 0, 0, 0), numTimes, a, b); }
554
public void call(Integer numTimes, QuaternionFloat64CartesianTensorProductMember a, QuaternionFloat64CartesianTensorProductMember b){ QuaternionFloat64Member factor = new QuaternionFloat64Member(0.5, 0, 0, 0); QuaternionFloat64CartesianTensorProductMember prod = G.QDBL_TEN.construct(a); for (int i = 0; i...
public void call(Integer numTimes, QuaternionFloat64CartesianTensorProductMember a, QuaternionFloat64CartesianTensorProductMember b){ ScaleHelper.compute(G.QDBL_TEN, G.QDBL, new QuaternionFloat64Member(0.5, 0, 0, 0), numTimes, a, b); }
555
private void sendMessage(String key, AgentMessage msg) throws IOException{ byte[] bytes = m_MessageBackend.toBytes(msg); if (bytes == null) { throw new IOException("Message serialisation failure"); } m_Messages.add(Message.create(bytes, false, null)); m_MessageWindow.getMessagePanel()....
private void sendMessage(String key, AgentMessage msg) throws IOException{ AMQPMessage amsg = m_AMQP.sendMessage(key, msg); m_Messages.add(Message.create(amsg.body, false, amsg.basicProperties)); m_MessageWindow.getMessagePanel().refreshMessages(); }
556
public void execute_noSuchBook_loanUnsuccessful(){ SerialNumber toLoan = BOOK_1.getSerialNumber(); BorrowerRecords borrowerRecords = new BorrowerRecords(); borrowerRecords.addBorrower(HOON); BorrowerId servingBorrowerId = HOON.getBorrowerId(); Model model = new ModelManager(new Catalog(), new L...
public void execute_noSuchBook_loanUnsuccessful(){ SerialNumber toLoan = BOOK_1.getSerialNumber(); BorrowerRecords borrowerRecords = new BorrowerRecords(); borrowerRecords.addBorrower(HOON); BorrowerId servingBorrowerId = HOON.getBorrowerId(); Model model = new ModelManager(new Catalog(), new L...
557
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_city_picker); toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); final Drawable upArrow = ContextCompat.getDrawable(this, R.mipmap.ic_arrow_back_wh...
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_city_picker); toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); final Drawable upArrow = ContextCompat.getDrawable(this, R.mipmap.ic_arrow_back_wh...
558
private String handleButtonEventImpl(Button button) throws CalculationException{ String buttonId = button.getId(); String textToSet = currentNumberText.getText(); if (isNumber(buttonId)) { resetAfterError(); String buttonText = button.getText(); boolean isDigitAppended = false;...
private String handleButtonEventImpl(Button button) throws CalculationException{ String textToSet = currentNumberText.getText(); Object buttonFunction = buttonsWithFunctions.get(button); if (buttonFunction instanceof Number) { resetAfterError(); String buttonText = button.getText(); ...
559
public void refreshList(){ adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, DevicesService.getInstance().getP2pDevicesNames()); devicesListView.setAdapter(adapter); }
public void refreshList(){ devicesListView.invalidate(); }
560
public void bureaucratAbility(Speler speler, Speler OtherPlayer, Pile silverPile){ if (silverPile.getAmount() > 0) { speler.getDrawDeck().addToDeck(0, silverPile.getCard()); silverPile.decrementAmount(); } Deck handDeck = OtherPlayer.getHandDeck(); ArrayList<Card> Vcards = new Arra...
public void bureaucratAbility(Speler speler, Speler OtherPlayer, Pile silverPile){ if (silverPile.getAmount() > 0) { speler.getDrawDeck().addToDeck(0, silverPile.getCard()); silverPile.decrementAmount(); } Deck handDeck = OtherPlayer.getHandDeck(); ArrayList<Card> Vcards = new Arra...
561
public void close(){ m_sendableImpl.close(); if (m_handle == 0) { return; } setDisabled(); PWMJNI.freePWMPort(m_handle); m_handle = 0; }
public void close(){ if (m_handle == 0) { return; } setDisabled(); PWMJNI.freePWMPort(m_handle); m_handle = 0; }
562
public int decodeNoisyDiff(int noisybits){ int value = 0; if (noisybits > 0) { value = decodeBits(noisybits) - (1 << (noisybits - 1)); } int val2 = decodeVarBits() << noisybits; if (val2 != 0) { if (decodeBit()) { val2 = -val2; } } return value ...
public int decodeNoisyDiff(final int noisybits){ int value = 0; if (noisybits > 0) { value = decodeBits(noisybits) - (1 << (noisybits - 1)); } int val2 = decodeVarBits() << noisybits; if (val2 != 0 && decodeBit()) { val2 = -val2; } return value + val2; }
563
public void portAddEventOnOnlineSwitch(){ SwitchInfoData switchAddEvent = new SwitchInfoData(alphaDatapath, SwitchChangeType.ACTIVATED, alphaInetAddress.toString(), alphaInetAddress.toString(), alphaDescription, speakerInetAddress.toString(), false, getSpeakerSwitchView()); NetworkSwitchService service = new ...
public void portAddEventOnOnlineSwitch(){ SwitchInfoData switchAddEvent = new SwitchInfoData(alphaDatapath, SwitchChangeType.ACTIVATED, alphaInetAddress.toString(), alphaInetAddress.toString(), alphaDescription, speakerInetAddress.toString(), false, getSpeakerSwitchView()); NetworkSwitchService service = new ...
564
public void paintComponent(CustGraphics _g){ _g.setColor(getBackground()); _g.fillRect(0, 0, getWidth(), getHeight()); _g.setColor(getForeground()); FontMetrics f_ = getFontMetrics(getFont()); int hLine_ = f_.getHeight(); int i_ = IndexConstants.FIRST_INDEX; for (String l : lines) { ...
public void paintComponent(CustGraphics _g){ _g.setColor(getBackground()); _g.fillRect(0, 0, getWidth(), getHeight()); _g.setColor(getForeground()); int hLine_ = heightFont(); int i_ = IndexConstants.FIRST_INDEX; for (String l : lines) { _g.drawString(l, 0, hLine_ * (i_ + 1)); ...
565
public Trip mapRow(ResultSet row, int i) throws SQLException{ Destination destination = new Destination(); destination.setName(row.getString("destination")); Trip trip = new Trip(); trip.setDestination(destination); trip.setAgencyFees(row.getInt("agency_fees")); trip.setStayFees(row.getInt...
public Trip mapRow(ResultSet row, int i) throws SQLException{ String dest = row.getString("destination"); int agencyFees = row.getInt("agency_fees"); int stayFees = row.getInt("stay_fees"); int ticketPrice = row.getInt("ticket_price"); Destination destination = new Destination(dest); retur...
566
public void startNewGame(GameLevelPrivileged gameLevel, DummyLevel level){ actors.clear(); searchResults.clear(); onDestroyActions.clear(); unregisteredActors.clear(); }
public void startNewGame(GameLevelPrivileged gameLevel, DummyLevel level){ actorActionMap.clear(); searchResults.clear(); unregisteredActors.clear(); }
567
public Result deleteProcessDefinitionById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam("processDefinitionId") Integer processDefinitionId){ logger.info("delete pr...
public Result<Void> deleteProcessDefinitionById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @RequestParam("processDefinitionId") Integer processDefinitionId){ logger.info("del...
568
public void setStyles(String styles) throws SerializationException{ if (styles == null) { throw new IllegalArgumentException("styles is null."); } setStyles(JSONSerializer.parseMap(styles)); }
public void setStyles(String styles) throws SerializationException{ Utils.checkNull(styles, "styles"); setStyles(JSONSerializer.parseMap(styles)); }
569
public List<SPTriple> transformQuad(Quad quad){ List<SPTriple> triples = new LinkedList<SPTriple>(); if (quad == null) { return null; } if (quad.getGraph() != null) { StringBuilder singletonBdr = null; singletonBdr = new StringBuilder(); singletonBdr.append(quad.g...
public SPTriple transformQuad(Quad quad){ if (quad == null) { return null; } if (quad.getGraph() != null && !quad.getPredicate().toString().equals(singletonPropertyOf.toString())) { StringBuilder singletonBdr = null; singletonBdr = new StringBuilder(); singletonBdr.app...
570
public String jsonRestTagBarcodes(@RequestParam("barcodeStrategy") String barcodeStrategy, @RequestParam("position") String position) throws IOException{ if (!isStringEmptyOrNull(barcodeStrategy)) { TagBarcodeStrategy tbs = tagBarcodeStrategyResolverService.getTagBarcodeStrategy(barcodeStrategy); ...
public String jsonRestTagBarcodes(@RequestParam("barcodeStrategy") String barcodeStrategy, @RequestParam("position") String position) throws IOException{ if (!isStringEmptyOrNull(barcodeStrategy)) { TagBarcodeFamily tbs = tagBarcodeStore.getTagBarcodeFamilyByName(barcodeStrategy); if (tbs != null...
571
public int loadIndiaCensusData(String csvFilePath) throws CensusAnalyserException{ try { Reader reader = Files.newBufferedReader(Paths.get(csvFilePath)); CsvToBeanBuilder<IndiaCensusCSV> csvToBeanBuilder = new CsvToBeanBuilder<>(reader); csvToBeanBuilder.withType(IndiaCensusCSV.class); ...
public int loadIndiaCensusData(String csvFilePath) throws CensusAnalyserException{ try (Reader reader = Files.newBufferedReader(Paths.get(csvFilePath))) { CsvToBeanBuilder<IndiaCensusCSV> csvToBeanBuilder = new CsvToBeanBuilder<>(reader); csvToBeanBuilder.withType(IndiaCensusCSV.class); ...
572
static MapToList<Ability, CNAbility> buildAbilityList(String key, View view, MapToList<Ability, CNAbility> listOfAbilities){ List<Ability> aList = new ArrayList<>(listOfAbilities.getKeySet()); Globals.sortPObjectListByName(aList); boolean matchKeyDef = false; boolean matchVisibilityDef = false; ...
static MapToList<Ability, CNAbility> buildAbilityList(String key, View view, MapToList<Ability, CNAbility> listOfAbilities){ List<Ability> aList = new ArrayList<>(listOfAbilities.getKeySet()); Globals.sortPObjectListByName(aList); boolean matchKeyDef = false; boolean matchVisibilityDef = false; ...
573
public void nextTuple(){ for (String word : words) { collector.emit(new Values(word)); } try { Thread.sleep(1000); } catch (InterruptedException e) { _log.error("error: {}", e.getMessage()); } }
public void nextTuple(){ for (String word : words) collector.emit(new Values(word)); try { Thread.sleep(1000); } catch (InterruptedException e) { _log.error("error: {}", e.getMessage()); } }
574
public void removeAll(CharID id, Object source){ Map<T, Set<Object>> componentMap = getCachedMap(id); if (componentMap != null) { List<T> removedKeys = new ArrayList<>(); for (Iterator<Map.Entry<T, Set<Object>>> it = componentMap.entrySet().iterator(); it.hasNext(); ) { Entry<T,...
public void removeAll(CharID id, Object source){ Map<T, Set<Object>> componentMap = getCachedMap(id); if (componentMap != null) { Collection<T> removedKeys = new ArrayList<>(); for (Iterator<Map.Entry<T, Set<Object>>> it = componentMap.entrySet().iterator(); it.hasNext(); ) { En...
575
public Optional<MetaData> meta(Map<String, Object> parameters){ final String brokers = ConnectorOptions.extractOption(parameters, "brokers"); final String topic = ConnectorOptions.extractOption(parameters, "topic"); if (topic == null) { LOG.debug("Retrieving Kafka topics for connection to {}", b...
public Optional<MetaData> meta(Map<String, Object> parameters){ final String topic = ConnectorOptions.extractOption(parameters, "topic"); final String brokers = ConnectorOptions.extractOption(parameters, "brokers"); final String certificate = ConnectorOptions.extractOption(parameters, "brokerCertificate"...
576
private static Bundle analyzeColor(ColorInfo photoColor, ArrayList<ResultRange> colorRange, Bundle bundle){ bundle.putInt(Config.RESULT_COLOR_KEY, photoColor.getColor()); double value = getNearestColorFromSwatchRange(photoColor.getColor(), colorRange); if (value < 0) { bundle.putDouble(Config.RE...
private static void analyzeColor(ColorInfo photoColor, ArrayList<ResultRange> colorRange, Bundle bundle){ bundle.putInt(Config.RESULT_COLOR_KEY, photoColor.getColor()); double value = getNearestColorFromSwatchRange(photoColor.getColor(), colorRange); if (value < 0) { bundle.putDouble(Config.RESU...
577
public void startActivity(String appPackage, String appActivity, String appWaitPackage, String appWaitActivity, String intentAction, String intentCategory, String intentFlags, String optionalIntentArguments, boolean stopApp) throws IllegalArgumentException{ checkArgument((!StringUtils.isBlank(appPackage) && !Strin...
public void startActivity(String appPackage, String appActivity, String appWaitPackage, String appWaitActivity, String intentAction, String intentCategory, String intentFlags, String optionalIntentArguments, boolean stopApp) throws IllegalArgumentException{ CommandExecutionHelper.execute(this, startActivityCommand...
578
public boolean equals(Object o){ if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; AuthenticationContextCacheKey that = (AuthenticationContextCacheKey) o; if (!contextId.equals(that.contextId)) ...
public boolean equals(Object o){ if (this == o) { return true; } if (o == null || getClass() != o.getClass() || !super.equals(o)) { return false; } AuthenticationContextCacheKey that = (AuthenticationContextCacheKey) o; return contextId.equals(that.contextId); }
579
public Result grantUDFFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "udfIds") String udfIds){ logger.info("login user {}, grant project, userId: {},resourceIds : {}", loginUser.getUserName(), userId, udfIds); ...
public Result<Void> grantUDFFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "userId") int userId, @RequestParam(value = "udfIds") String udfIds){ logger.info("login user {}, grant project, userId: {},resourceIds : {}", loginUser.getUserName(), userId, udfIds)...
580
public void testMultiQRCodes() throws Exception{ Path testBase = AbstractBlackBoxTestCase.buildTestBase("src/test/resources/blackbox/multi-qrcode-1"); Path testImage = testBase.resolve("1.png"); BufferedImage image = ImageIO.read(testImage.toFile()); LuminanceSource source = new BufferedImageLuminan...
public void testMultiQRCodes() throws Exception{ Path testBase = AbstractBlackBoxTestCase.buildTestBase("src/test/resources/blackbox/multi-qrcode-1"); Path testImage = testBase.resolve("1.png"); BufferedImage image = ImageIO.read(testImage.toFile()); LuminanceSource source = new BufferedImageLuminan...
581
public StockQtyAndUOMQty extractQtys(final IHUContext huContext, final ProductId productId, final Quantity pickedQty, final I_M_HU huRecord){ final IUOMConversionBL uomConversionBL = Services.get(IUOMConversionBL.class); final IProductBL productBL = Services.get(IProductBL.class); final UomId stockUOMId ...
public StockQtyAndUOMQty extractQtys(final IHUContext huContext, final ProductId productId, final Quantity pickedQty, final I_M_HU huRecord){ final IUOMConversionBL uomConversionBL = Services.get(IUOMConversionBL.class); final IProductBL productBL = Services.get(IProductBL.class); final UomId stockUOMId ...
582
public void onFocusChange(View view, boolean b){ Log.d("onfocus", "onFocusChange: "); if (editText.isFocused()) { editText.getBackground().setColorFilter(activity.getResources().getColor(R.color.colorPrimary), PorterDuff.Mode.SRC_ATOP); previusEditTextString = editText.getText().toString(); ...
public void onFocusChange(View view, boolean b){ if (editText.isFocused()) { editText.getBackground().setColorFilter(activity.getResources().getColor(R.color.colorPrimary), PorterDuff.Mode.SRC_ATOP); previusEditTextString = editText.getText().toString(); showKeyboard(activity); } el...
583
public void task12(){ Scanner scanner = new Scanner(System.in); int k = scanner.nextInt(); int N = scanner.nextInt(); Integer[][] matrix = new Integer[N][N]; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { matrix[i][j] = scanner.nextInt(); } } ...
public void task12(){ Scanner scanner = new Scanner(System.in); int k = scanner.nextInt(); int N = scanner.nextInt(); Integer[][] matrix = new Integer[N][N]; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { matrix[i][j] = scanner.nextInt(); } } ...
584
public void calculate1Test(){ StringBuilder xml_ = new StringBuilder(); xml_.append("$public $enum pkg.Ex {;\n"); xml_.append("$public $enum ExInner {\n"); xml_.append(" ONE{\n"); xml_.append(" $public $class InnerInner{\n"); xml_.append(" $public $int field = 6;\n"); xml_.append(" }...
public void calculate1Test(){ StringBuilder xml_ = new StringBuilder(); xml_.append("$public $enum pkg.Ex {;\n"); xml_.append("$public $enum ExInner {\n"); xml_.append(" ONE{\n"); xml_.append(" $public $class InnerInner{\n"); xml_.append(" $public $int field = 6;\n"); xml_.append(" }...
585
public void testSetMetacardContentTypeToCswRecordType() throws ParserConfigurationException, SAXException, IOException{ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); Document doc = docBuilder.parse(TestCswRecordConv...
public void testSetMetacardContentTypeToCswRecordType() throws ParserConfigurationException, SAXException, IOException{ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); Document doc = docBuilder.parse(TestCswRecordConv...
586
private BoundStatement buildStatementLatestVideoPage(String yyyymmdd, Optional<String> pagingState, AtomicBoolean cassandraPagingStateUsed, Optional<Instant> startingAddedDate, Optional<UUID> startingVideoId, int recordNeeded){ BoundStatementBuilder statementBuilder; if (startingAddedDate.isPresent() && start...
private BoundStatement buildStatementLatestVideoPage(String yyyymmdd, Optional<String> pagingState, AtomicBoolean cassandraPagingStateUsed, Optional<Instant> startingAddedDate, Optional<UUID> startingVideoId, int recordNeeded){ BoundStatementBuilder statementBuilder = getBoundStatementBuilder(yyyymmdd, startingAdd...
587
public Map<String, Object> execute(Map<String, Object> input, ProgressListener monitor) throws ProcessException{ if (started) throw new IllegalStateException("Process can only be run once"); started = true; if (monitor == null) monitor = new NullProgressListener(); try { m...
public Map<String, Object> execute(Map<String, Object> input, ProgressListener monitor) throws ProcessException{ if (started) throw new IllegalStateException("Process can only be run once"); started = true; try { SimpleFeatureCollection inputFeatures = (SimpleFeatureCollection) Params.g...
588
public static Object loadObject(String _nomFichier){ String content_ = contentsOfFile(_nomFichier); try { return SerializeXmlObject.fromXmlStringObject(content_); } catch (Throwable _0) { if (content_ == null) { content_ = EMPTY_STRING; } String message_ =...
public static Object loadObject(String _nomFichier){ String content_ = contentsOfFile(_nomFichier); try { return SerializeXmlObject.fromXmlStringObject(content_); } catch (Throwable _0) { return null; } }
589
public NodeList getElementsByTagName(){ NodeList elements_ = new NodeList(); if (getFirstChild() == null) { elements_.add(this); return elements_; } Element root_ = this; Node current_ = this; while (current_ != null) { if (current_ instanceof Element) { ...
public NodeList getElementsByTagName(){ NodeList elements_ = new NodeList(); if (getFirstChild() == null) { elements_.add(this); return elements_; } Element root_ = this; Node current_ = this; while (current_ != null) { if (current_ instanceof Element) { ...
590
public void calculateByUpTo(){ int upToValue = 0; String firstDateOfFirstGroup = data.getRowsFromStartDate().get(0).getDate(); ArrayList<Row> rowsFromCSV = data.getRows(); for (Row row : rowsFromCSV) { if (row.getLocation().equals(data.getLocation())) { if (row.getDate().equals...
public void calculateByUpTo(){ int upToValue = 0; String firstDateOfFirstGroup = data.getRowsFromStartDate().get(0).getDate(); ArrayList<Row> rowsFromCSV = data.getRows(); for (Row row : rowsFromCSV) { if (row.getLocation().equals(data.getLocation())) { if (row.getDate().equals...
591
protected void channelRead0(ChannelHandlerContext ctx, LanMessage msg) throws Exception{ logger.info("[ {} ]【{}-{}】收到 ss server 请求信息: {}", ctx.channel().id(), getSimpleName(this), msg.getRequestId(), msg); switch(msg.getType()) { case HEARTBEAT: handleHeartbeatMessage(ctx, msg); ...
protected void channelRead0(ChannelHandlerContext ctx, LanMessage msg) throws InvalidAlgorithmParameterException, IOException{ switch(msg.getType()) { case HEARTBEAT: handleHeartbeatMessage(ctx, msg); break; case CONNECT: handleConnectionMessage(ctx, msg); ...
592
public boolean execute(String sql) throws SQLException{ if (currentResultSet != null) { currentResultSet.close(); currentResultSet = null; } try { Optional<String> clientRequestToken = clientRequestTokenProvider.apply(sql); StartQueryExecutionResponse startResponse = a...
public boolean execute(String sql) throws SQLException{ if (currentResultSet != null) { currentResultSet.close(); currentResultSet = null; } try { queryExecutionId = startQueryExecution(sql); currentResultSet = configuration.pollingStrategy().pollUntilCompleted(this::p...
593
private static void createTypes(String keyspace, List<CreateTypeStatement.Raw> typeStatements){ KeyspaceMetadata ksm = Schema.instance.getKeyspaceMetadata(keyspace); Types.RawBuilder builder = Types.rawBuilder(keyspace); for (CreateTypeStatement.Raw st : typeStatements) st.addToRawBuilder(builder); ...
private static Types createTypes(String keyspace, List<CreateTypeStatement.Raw> typeStatements){ KeyspaceMetadata ksm = Schema.instance.getKeyspaceMetadata(keyspace); Types.RawBuilder builder = Types.rawBuilder(keyspace); for (CreateTypeStatement.Raw st : typeStatements) st.addToRawBuilder(builder); ...
594
protected void onBindView(@NonNull View view){ super.onBindView(view); ButterKnife.bind(this, view); recyclerView.setAdapter(new UserSceneListAdapter(presenter)); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); setHasOptionsMenu(true); getActivity().setTitle(R.string....
protected void onBindView(@NonNull View view){ super.onBindView(view); ButterKnife.bind(this, view); recyclerView.setAdapter(new UserSceneListAdapter(presenter)); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); setHasOptionsMenu(true); }
595
public void printSeq(BinaryTree binaryTree){ List<Node> ancestors = new ArrayList<>(); List<Node> children = new ArrayList<>(); generateSeq(ancestors, children, binaryTree.root); for (List<Node> sequence : sequences) { for (Node node : sequence) { System.out.print(node.data + "...
public void printSeq(){ for (List<Node> sequence : sequences) { for (Node node : sequence) { System.out.print(node.data + " "); } System.out.println(); } }
596
public String[] getUserNames(){ if (users == null) return null; int index = 0; String[] userNames = new String[users.length]; for (User user : users) { if (user != null) { userNames[index] = user.getName(); index++; } } return userNames;...
public String[] getUserNames(){ int index = 0; String[] userNames = new String[users.length]; for (User user : users) { if (user != null) { userNames[index] = user.getName(); index++; } } return userNames; }
597
private void processOperator(Operator operator, List<COSBase> operands) throws IOException{ String name = operator.getName(); switch(name) { case "Tf": processSetFont(operands); break; case "g": processSetFontColor(operands); break; ...
private void processOperator(Operator operator, List<COSBase> operands) throws IOException{ switch(operator.getName()) { case "Tf": processSetFont(operands); break; case "g": case "rg": case "k": processSetFontColor(operands); ...
598
protected AbstractHandlerMapping getHandlerMapping(){ if (this.registrations.isEmpty()) { return null; } Map<String, HttpRequestHandler> urlMap = new LinkedHashMap<>(); for (ResourceHandlerRegistration registration : this.registrations) { for (String pathPattern : registration.getP...
protected AbstractHandlerMapping getHandlerMapping(){ if (this.registrations.isEmpty()) { return null; } Map<String, HttpRequestHandler> urlMap = new LinkedHashMap<>(); for (ResourceHandlerRegistration registration : this.registrations) { for (String pathPattern : registration.getP...
599
public APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent input, Context context){ APIGatewayProxyResponseEvent apiGatewayProxyResponseEvent = new APIGatewayProxyResponseEvent(); LambdaLogger logger = context.getLogger(); Map<String, String> requestBody = PARSE_REQUEST_BODY(input.getB...
public APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent input, Context context){ LambdaLogger logger = context.getLogger(); Map<String, String> requestBody = PARSE_REQUEST_BODY(input.getBody()); if (!requestBody.containsKey("code") || !requestBody.containsKey("client_id") || !reques...