Unnamed: 0
int64
0
9.45k
cwe_id
stringclasses
1 value
source
stringlengths
37
2.53k
target
stringlengths
19
2.4k
200
public Map<String, Object> queryTaskListByProcessId(User loginUser, String projectName, Integer processId) throws IOException{ Map<String, Object> result = new HashMap<>(); Project project = projectMapper.queryByName(projectName); Map<String, Object> checkResult = projectService.checkProjectAndAuth(login...
public Result<Map<String, Object>> queryTaskListByProcessId(User loginUser, String projectName, Integer processId) throws IOException{ Project project = projectMapper.queryByName(projectName); CheckParamResult checkResult = projectService.checkProjectAndAuth(loginUser, project, projectName); if (!Status....
201
public ModelAndView searchLast(@Valid @ModelAttribute("searchRecordsRequest") SearchRecordsRequest searchRecordsRequest, BindingResult result, Model model){ searchRecordsRequest.setSearchResultRows(null); searchRecordsRequest.setPageNumber(searchRecordsRequest.getTotalPageCount() - 1); searchRecordsUtil....
public ModelAndView searchLast(@Valid @ModelAttribute("searchRecordsRequest") SearchRecordsRequest searchRecordsRequest, BindingResult result, Model model){ searchRecordsRequest.setPageNumber(searchRecordsRequest.getTotalPageCount() - 1); searchAndSetResults(searchRecordsRequest); return new ModelAndView...
202
public static void countFileLines(String fileName){ BufferedReader in = null; try { in = new BufferedReader(new InputStreamReader(new FileInputStream(fileName), Constant.UTF_8)); boolean stop = false; while (!stop) { final String line = in.readLine(); if (l...
public static void countFileLines(String fileName){ try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(fileName), Constant.UTF_8))) { boolean stop = false; while (!stop) { final String line = in.readLine(); if (line != null) { ...
203
private ApplicationWithPrograms deployApp(Id.Namespace namespace, @Nullable String appName, @Nullable String configStr, ProgramTerminator programTerminator, ArtifactDetail artifactDetail) throws Exception{ authorizerInstantiatorService.get().enforce(namespace.toEntityId(), SecurityRequestContext.toPrincipal(), Act...
private ApplicationWithPrograms deployApp(NamespaceId namespaceId, @Nullable String appName, @Nullable String configStr, ProgramTerminator programTerminator, ArtifactDetail artifactDetail) throws Exception{ authorizerInstantiatorService.get().enforce(namespaceId, SecurityRequestContext.toPrincipal(), Action.WRITE)...
204
public Future<?> reloadTimeDependentDataInContacts(){ return this.executor.submit(() -> { final Context context = getApplication().getApplicationContext(); final ZodiacCalculator zodiacCalculator = new ZodiacCalculator(); final DateConverter dateConverter = new DateConverter(); ...
public Future<?> reloadTimeDependentDataInContacts(){ return this.executor.submit(() -> { final Context context = getApplication().getApplicationContext(); final ContactCreator contactCreator = new ContactCreatorFactory().createContactCreator(context); final LocalDate now = LocalDate.now...
205
public Map<String, Object> countCommandState(User loginUser, int projectId, String startDate, String endDate){ Map<String, Object> result = new HashMap<>(); boolean checkProject = checkProject(loginUser, projectId, result); if (!checkProject) { return result; } Date start = null; ...
public Result<List<CommandStateCount>> countCommandState(User loginUser, int projectId, String startDate, String endDate){ CheckParamResult checkResult = checkProject(loginUser, projectId); if (!Status.SUCCESS.equals(checkResult.getStatus())) { return Result.error(checkResult); } Date start...
206
String transform(){ final String specialCharactersRegex = "[^a-zA-Z0-9\\s+]"; final String inputCharacters = "abcdefghijklmnopqrstuvwxyz"; Map<Character, ArrayList<String>> letterOccurenceMap = new LinkedHashMap<Character, ArrayList<String>>(); if (input.equals("")) { return input; } ...
String transform(){ Map<Character, ArrayList<String>> letterOccurrenceMap = new LinkedHashMap<Character, ArrayList<String>>(); if (input.equals("")) { return input; } input = input.toLowerCase(); input = input.replaceAll(specialCharactersRegex, ""); String[] words = input.split("...
207
public Response simpleSearchWithSchemaName(@PathParam("index") final String index, @PathParam("schemaName") final String schemaName, @QueryParam("q") final String queryString, @QueryParam("f") final Integer from, @Context final UriInfo uriInfo){ final SearchResult results = dox.searchWithSchemaName(index, schemaNa...
public Response simpleSearchWithSchemaName(@PathParam("index") final String index, @PathParam("schemaName") final String schemaName, @QueryParam("q") final String queryString, @QueryParam("f") final Integer from, @Context final UriInfo uriInfo){ final SearchResult results = dox.searchWithSchemaName(index, schemaNa...
208
public void createUsers() throws IOException{ AddressBook ab = new AddressBook(); Person salvador = new Person(); salvador.setName("Salvador"); salvador.setId(ab.nextId()); ab.getPersonList().add(salvador); launchServer(ab); final Client CLIENT = ClientBuilder.newClient(); Person...
public void createUsers() throws IOException{ AddressBook ab = new AddressBook(); Person salvador = new Person(); salvador.setName("Salvador"); salvador.setId(ab.nextId()); ab.getPersonList().add(salvador); launchServer(ab); Person juan = new Person(); juan.setName("Juan"); ...
209
public boolean switchIsOperable(SwitchId switchId){ if (cacheContainsSwitch(switchId)) { SwitchState switchState = switchPool.get(switchId).getState(); if (SwitchState.ADDED == switchState || SwitchState.ACTIVATED == switchState) { return true; } } return false; }
public boolean switchIsOperable(SwitchId switchId){ if (cacheContainsSwitch(switchId)) { SwitchChangeType switchState = switchPool.get(switchId).getState(); return SwitchChangeType.ADDED == switchState || SwitchChangeType.ACTIVATED == switchState; } return false; }
210
public static void startGame(Scanner sc){ Player player = new Player(); boolean playGame = true; int roomID = 0; while (playGame) { System.out.println("You are in " + GameMap.getRooms().get(roomID).getRoomName()); System.out.println(GameMap.getRooms().get(roomID).getRoomDesc()); ...
public static void startGame(Scanner sc){ Player player = new Player(); GameMap map = new GameMap(); boolean playGame = true; int roomID = 0; while (playGame) { System.out.println("You are in " + GameMap.getRooms().get(roomID).getRoomName()); System.out.println(GameMap.getRoom...
211
protected void buildConditions(ContextEl _cont){ AssignedBooleanVariables res_ = (AssignedBooleanVariables) _cont.getAnalyzing().getAssignedVariables().getFinalVariables().getVal(this); for (EntryCust<String, Assignment> e : res_.getLastFieldsOrEmpty().entryList()) { BooleanAssignment ba_ = e.getValu...
protected void buildConditions(ContextEl _cont){ AssignedBooleanVariables res_ = (AssignedBooleanVariables) _cont.getAnalyzing().getAssignedVariables().getFinalVariables().getVal(this); res_.getFieldsRootAfter().putAllMap(AssignmentsUtil.toBoolAssign(res_.getLastFieldsOrEmpty())); res_.getVariablesRootAf...
212
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ View rootView = inflater.inflate(R.layout.fragment_main, container, false); ArrayList<String> forecasts = new ArrayList<>(); forecasts.add(0, "Today β€” Sunny β€” 88 / 63"); forecasts.add(1, "Tomorrow β€” Fo...
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ View rootView = inflater.inflate(R.layout.fragment_main, container, false); ArrayList<String> forecasts = new ArrayList<>(); forecastAdapter = new ArrayAdapter<>(getActivity(), R.layout.list_item_forecast, ...
213
public boolean checkLoginExistInDB(String login) throws LoginExistException{ boolean isLoginExists = UserDB.Request.Create.checkLoginExist(login); if (isLoginExists) { throw new LoginExistException(); } return false; }
public boolean checkLoginExistInDB(String login){ return UserDB.Request.checkLoginExist(login); }
214
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_list); mBucketItems = new ArrayList<>(); fab = findViewById(R.id.fab); mListView = findViewById(R.id.listView); mAuth = FirebaseAuth.getInstance(); user = mAuth.get...
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_list); mBucketItems = new ArrayList<>(); fab = findViewById(R.id.fab); mListView = findViewById(R.id.listView); mAuth = FirebaseAuth.getInstance(); user = mAuth.get...
215
public static StandardResponse<User> loginUser(Request request, Response response, Datastore datastore){ var map = new Gson().fromJson(request.body(), Map.class); String password = (String) map.get("password"); String username = (String) map.get("username"); User user = datastore.find(User.class).fi...
public static StandardResponse<User> loginUser(Request request, Response response, Datastore datastore){ var map = new Gson().fromJson(request.body(), Map.class); String password = (String) map.get("password"); String username = (String) map.get("username"); User user = datastore.find(User.class).fi...
216
public JsonArray readNotifications(OffsetDateTime start, OffsetDateTime end){ logger.info("********************"); logger.info("ReadNotifications..."); logger.info("********************"); try { while (!this.active) { try { Thread.sleep(200); } cat...
public JsonArray readNotifications(OffsetDateTime start, OffsetDateTime end){ try { while (!this.active) { try { Thread.sleep(200); } catch (InterruptedException e) { logger.debug(e.getMessage(), e); } } Future<Json...
217
void writeBranching(String command, String label){ if (AssemblyCommand.LABEL.equals(command)) { aw.addLabel(label); } else if (AssemblyCommand.GOTO.equals(command)) { aw.jumpTo(label); } else if (AssemblyCommand.IF_GOTO.equals(command)) { aw.pop(); aw.add("D=M"); ...
void writeBranching(String command, String label){ if (AssemblyCommand.LABEL.equals(command)) { aw.addLabel(label); } else if (AssemblyCommand.GOTO.equals(command)) { aw.jumpTo(label); } else if (AssemblyCommand.IF_GOTO.equals(command)) { aw.conditionallyJumpTo(label); } ...
218
public StringBuffer getRequestURL(){ StringBuffer url = new StringBuffer(); String scheme = getScheme(); int port = getServerPort(); if (port < 0) port = 80; url.append(scheme); url.append("://"); url.append(getServerName()); if ((scheme.equals("http") && (port != 80)) |...
public StringBuffer getRequestURL(){ return RequestUtil.getRequestURL(this); }
219
public List<Requirement> loadByCarrierIdAndStatus(@PathVariable(value = "carrierId") long carrierId, @PathVariable(value = "status") int status){ List<RequirementData> requirementList = requirementService.getByCarrierIdAndStatus(carrierId, status); List<Requirement> requirements = new ArrayList<Requirement>()...
public List<Requirement> loadByCarrierIdAndStatus(@PathVariable(value = "carrierId") long carrierId, @PathVariable(value = "status") int status){ return requirementService.getByCarrierIdAndStatus(carrierId, status); }
220
public void doCheck(String productNum){ theBasket.clear(); String theAction = ""; pn = productNum.trim(); int amount = 1; try { if (theStock.exists(pn)) { Product pr = theStock.getDetails(pn); if (pr.getQuantity() >= amount) { theAction = Stri...
public void doCheck(String productNum){ theBasket.clear(); String theAction = ""; pn = productNum.trim(); int amount = 1; try { if (theStock.exists(pn)) { Product pr = theStock.getDetails(pn); if (pr.getQuantity() >= amount) { theAction = Stri...
221
public void add(IDT id, T obj, Object source){ if (obj == null) { throw new IllegalArgumentException("Object to add may not be null"); } Map<T, Set<Object>> map = getConstructingCachedMap(id); Set<Object> set = map.get(obj); boolean fireNew = (set == null); if (fireNew) { ...
public void add(IDT id, T obj, Object source){ Objects.requireNonNull(obj); Map<T, Set<Object>> map = getConstructingCachedMap(id); Set<Object> set = map.get(obj); boolean fireNew = (set == null); if (fireNew) { set = new WrappedMapSet<>(IdentityHashMap.class); map.put(obj, se...
222
public static void Tooltip(final Variables variables){ variables.view.setVertexToolTipTransformer(new ToStringLabeller() { @Override public String transform(Object v) { if (v instanceof Graph) { return "<html>" + GraphTooltip(v) + "</html>"; } ...
public static void Tooltip(final Variables variables){ variables.view.setVertexToolTipTransformer(new ToStringLabeller() { @Override public String transform(Object v) { ((Vertex) v).setTimeScalePrint(variables.config.timeScale, variables.selectedTimeScale); return "<ht...
223
private boolean initializeRobot(){ boolean robotCheck = false; int[] values = null; Character direction = null; if (!this.running) { return false; } while (!robotCheck) { System.out.println("Submit robot starting position and direction. " + "Enter two numbers and a direct...
private boolean initializeRobot(){ boolean robotCheck = false; int[] values = null; Character direction = null; if (!this.running) { return false; } while (!robotCheck) { System.out.println("\nSubmit robot starting position and direction. " + "Enter two numbers and a dire...
224
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...
225
public static void buildFilesBodies(StringMap<String> _files, boolean _predefined, AnalyzedPageEl _page){ for (EntryCust<String, String> f : _files.entryList()) { String file_ = f.getKey(); String content_ = f.getValue(); FileBlock fileBlock_ = new FileBlock(new OffsetsBlock(), _predefin...
public static void buildFilesBodies(StringMap<String> _files, boolean _predefined, AnalyzedPageEl _page){ for (EntryCust<String, String> f : _files.entryList()) { String file_ = f.getKey(); String content_ = f.getValue(); FileBlock fileBlock_ = new FileBlock(new OffsetsBlock(), _predefin...
226
private static String[] getArgsArray(Map<String, String> props){ String[] args = FluentIterable.from(props.entrySet()).transform(new Function<Entry<String, String>, String>() { @Override public String apply(Entry<String, String> input) { return "--" + input.getKey() + "=" + input.g...
private static String[] getArgsArray(Map<String, String> props){ String[] args = props.entrySet().stream().map(input -> "--" + input.getKey() + "=" + input.getValue()).toArray(String[]::new); return args; }
227
private void onDataLoadComplete(){ Log.d(TAG, "onDataLoadComplete()"); mProgressBar.setVisibility(View.INVISIBLE); mPopularMoviesAdaptor = new PopularMoviesAdaptor(getNumberOfItems(), this); mMoviePostersRecyclerView.setAdapter(mPopularMoviesAdaptor); }
private void onDataLoadComplete(){ Log.d(TAG, "onDataLoadComplete()"); mProgressBar.setVisibility(View.INVISIBLE); mMoviePostersRecyclerView.setAdapter(new PopularMoviesAdaptor(getNumberOfItems(), this)); }
228
private Member findMember(){ Member member = JDAHelper.getMemberByID(JDAHelper.splitString(commandParameters)[1]); if (member == null) { member = JDAHelper.getMemberByUsername(JDAHelper.splitString(commandParameters)[1]); if (member == null) { member = JDAHelper.getMember(event....
private Member findMember(GuildMessageReceivedEvent event){ if (!event.getMessage().getMentionedUsers().isEmpty()) { return JDAHelper.getMember(event.getMessage().getMentionedUsers().get(0)); } sendMessage("Please mention a valid user"); return null; }
229
public Task deleteTask(int i) throws DukeInputException{ Task t; try { t = lst.get(i); lst.remove(i); } catch (IndexOutOfBoundsException e) { throw new DukeInputException(String.format("\"%d\" is an invalid number!", i - 1)); } return t; }
public Task deleteTask(int i) throws DukeInputException{ Task t; try { t = lst.remove(i); } catch (IndexOutOfBoundsException e) { throw new DukeInputException(String.format("\"%d\" is an invalid number!", i - 1)); } return t; }
230
public void AddNoiseLevelTest(){ try { Scope.enter(); final Frame fr = new TestFrameBuilder().withColNames("ColA", "ColB", "ColC").withVecTypes(Vec.T_NUM, Vec.T_NUM, Vec.T_NUM).withDataForCol(0, ard(1, 2, 3)).withDataForCol(1, ard(1, 2, 3)).withDataForCol(2, ard(1, 2, 3)).build(); Scope....
public void AddNoiseLevelTest(){ try { Scope.enter(); final Frame fr = new TestFrameBuilder().withColNames("ColA", "ColB", "ColC").withVecTypes(Vec.T_NUM, Vec.T_NUM, Vec.T_NUM).withDataForCol(0, ard(1, 2, 3)).withDataForCol(1, ard(1, 2, 3)).withDataForCol(2, ard(1, 2, 3)).build(); double...
231
private static void processLeftIndexer(VariablesOffsets _vars, String _currentFileName, int _sum, OperationNode _val, CustList<PartOffset> _parts){ if (_val instanceof ArrOperation) { ArrOperation par_ = (ArrOperation) _val; ClassMethodId classMethodId_ = par_.getCallFctContent().getClassMethodId...
private static void processLeftIndexer(VariablesOffsets _vars, String _currentFileName, int _sum, OperationNode _val, CustList<PartOffset> _parts){ if (_val instanceof ArrOperation) { ArrOperation par_ = (ArrOperation) _val; AnaTypeFct function_; if (par_.getArrContent().isVariable()) { ...
232
private FieldSpec buildSpec(DataGeneratorSpec genSpec, String column){ DataType dataType = genSpec.getDataTypesMap().get(column); FieldType fieldType = genSpec.getFieldTypesMap().get(column); FieldSpec spec; switch(fieldType) { case DIMENSION: spec = new DimensionFieldSpec(); ...
private FieldSpec buildSpec(DataGeneratorSpec genSpec, String column){ DataType dataType = genSpec.getDataTypesMap().get(column); FieldType fieldType = genSpec.getFieldTypesMap().get(column); FieldSpec spec; switch(fieldType) { case DIMENSION: spec = new DimensionFieldSpec(); ...
233
public void createNewUserAndDelete() throws Exception{ UserDTO newUser = new UserDTO(organizacionAdmin); newUser.setId(null); newUser.setUsername(NEW_USER_USERNAME); String uri = mvc.perform(post("/api/users").contentType(MediaType.APPLICATION_JSON).content(asJsonString(newUser)).with(SecurityMockMv...
public void createNewUserAndDelete() throws Exception{ User newUser = organizacionAdmin.toBuilder().id(null).username(NEW_USER_USERNAME).build(); String uri = mvc.perform(post("/api/users").contentType(MediaType.APPLICATION_JSON).content(asJsonString(newUser)).with(SecurityMockMvcRequestPostProcessors.user(SI...
234
public void delete() throws Exception{ underTest.delete("123"); ; }
public void delete() throws Exception{ underTest.delete("123"); }
235
public Move evaluate(Maze pMaze){ if (pMaze.isWallNorth()) { return Move.WEST; } else { if ((pMaze.isWallSouthEast() || pMaze.isWallSouth())) { if (pMaze.isWallEast()) { return Move.NORTH; } else { return Move.EAST; } ...
public Move evaluate(Maze pMaze){ return null; }
236
public void getRemoteImage(final BodyPosition position){ final PostImage postImage = new PostImage(); postImage.ObjectID = position.Content.ImageID; final SharedPreferences.Editor editor = preferences.edit(); String Image = preferences.getString(position.Content.ImageID, ""); if (Image != null ...
private void getRemoteImage(final BodyPosition position){ final PostImage postImage = new PostImage(position.getContent().getImageID()); final SharedPreferences.Editor editor = preferences.edit(); String ImageData = preferences.getString(position.getContent().getImageID(), ""); if (ImageData != null...
237
public Boolean getMapFiles(String s){ Boolean mapAvailable = false; File folder = new File(s); File[] listOfFiles = null; if (folder.exists()) { listOfFiles = folder.listFiles(); } if (listOfFiles != null) { mapAvailable = true; for (int i = 0; i < listOfFiles.le...
public ArrayList<String> getMapFiles(String folderPath){ ArrayList<String> files = new ArrayList<String>(); File folder = new File(folderPath); File[] listOfFiles = null; if (folder.exists()) { listOfFiles = folder.listFiles(); } if (listOfFiles != null) { for (int i = 0;...
238
public void testZSession_Jdbc_Submit() throws Exception{ Map<String, String> intpProperties = new HashMap<>(); intpProperties.put("default.driver", "com.mysql.jdbc.Driver"); intpProperties.put("default.url", "jdbc:mysql://localhost:3306/"); intpProperties.put("default.user", "root"); intpProper...
public void testZSession_Jdbc_Submit() throws Exception{ Map<String, String> intpProperties = new HashMap<>(); intpProperties.put("default.driver", "com.mysql.jdbc.Driver"); intpProperties.put("default.url", "jdbc:mysql://localhost:3306/"); intpProperties.put("default.user", "root"); ZSession s...
239
private void openLine() throws LineUnavailableException{ logger.info("Entered OpenLine()!:\n"); if (sourceDataLine != null) { AudioFormat audioFormat = audioInputStream.getFormat(); int bufferSize = (bufferSize = lineBufferSize) >= 0 ? bufferSize : sourceDataLine.getBufferSize(); cu...
private void openLine() throws LineUnavailableException{ logger.info("Entered OpenLine()!:\n"); if (sourceDataLine != null) { AudioFormat audioFormat = audioInputStream.getFormat(); int bufferSize = (bufferSize = lineBufferSize) >= 0 ? bufferSize : sourceDataLine.getBufferSize(); cu...
240
public Result updateUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int udfFuncId, @RequestParam(value = "type") UdfType type, @RequestParam(value = "funcName") String funcName, @RequestParam(value = "className") String className, @RequestParam(value = "a...
public Result<Void> updateUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int udfFuncId, @RequestParam(value = "type") UdfType type, @RequestParam(value = "funcName") String funcName, @RequestParam(value = "className") String className, @RequestParam(valu...
241
public String updateUserDay(Model model, WebRequest request){ User user = userService.getUserByName(request.getUserPrincipal().getName()); int id = Integer.parseInt(request.getParameter("id")); UserDay userDay = userDayService.getUserDayById(id); String shift = request.getParameter("shift"); if...
public String updateUserDay(Model model, WebRequest request){ int id = Integer.parseInt(request.getParameter("id")); UserDay userDay = userDayService.getUserDayById(id); String shift = request.getParameter("shift"); if (shift.equals("day")) { userDay.setShift(Shift.DAY); } else if (shi...
242
public User sendVerificationCode(User user){ String code = UUID.randomUUID().toString(); user.setActivationCode(code); emailService.sendVerificationEmailTo(user); return user; }
public User sendVerificationCode(final User user){ user.setActivationCode(UUID.randomUUID().toString()); emailService.sendVerificationEmailTo(user); return user; }
243
public void createNewString(ArrayCallback callback, int count, Encoding encoding){ loadRuntime(); ByteList startingDstr = new ByteList(StandardASMCompiler.STARTING_DSTR_SIZE); if (encoding != null) { startingDstr.setEncoding(encoding); } script.getCacheCompiler().cacheByteList(this, st...
public void createNewString(ArrayCallback callback, int count, Encoding encoding){ loadRuntime(); method.ldc(StandardASMCompiler.STARTING_DSTR_FACTOR * count); if (encoding == null) { method.invokestatic(p(RubyString.class), "newStringLight", sig(RubyString.class, Ruby.class, int.class)); }...
244
private static void processQuickEl(String _el, AnalyzedTestConfiguration _cont){ String gl_ = _cont.getArgument().getStruct().getClassName(_cont.getContext()); _cont.getAnalyzing().setGlobalType(new AnaFormattedRootBlock(_cont.getAnalyzing(), gl_)); CustList<OperationNode> all_ = getQuickAnalyzed(_el, 0,...
private static void processQuickEl(String _el, AnalyzedTestConfiguration _cont){ String gl_ = _cont.getArgument().getStruct().getClassName(_cont.getContext()); _cont.getAnalyzing().setGlobalType(new AnaFormattedRootBlock(_cont.getAnalyzing(), gl_)); CustList<OperationNode> all_ = getQuickAnalyzed(_el, 0,...
245
public void onChange(Game game, Player player, SignChangeEvent sign){ String thirdLine = ChatColor.stripColor(sign.getLine(2)); String fourthLine = ChatColor.stripColor(sign.getLine(3)); PerkType type = PerkType.DEADSHOT_DAIQ; type = type.getPerkType(thirdLine); if (type == null) { sig...
public void onChange(Game game, Player player, SignChangeEvent sign){ String thirdLine = ChatColor.stripColor(sign.getLine(2)); String fourthLine = ChatColor.stripColor(sign.getLine(3)); PerkType type = PerkType.getPerkType(thirdLine); if (type == null) { sign.setLine(0, ChatColor.RED + "" ...
246
private void checkInstalledApps(){ BrokerPool pool = null; DBBroker broker = null; try { pool = BrokerPool.getInstance(); broker = pool.get(pool.getSecurityManager().getSystemSubject()); final XQuery xquery = pool.getXQueryService(); final Sequence pkgs = xquery.execut...
private void checkInstalledApps(){ try { final BrokerPool pool = BrokerPool.getInstance(); try (final DBBroker broker = pool.get(Optional.of(pool.getSecurityManager().getSystemSubject()))) { final XQuery xquery = pool.getXQueryService(); final Sequence pkgs = xquery.exec...
247
public Result list(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser){ logger.info("login user {}, query all alertGroup", loginUser.getUserName()); Map<String, Object> result = alertGroupService.queryAlertgroup(); return returnDataList(result); }
public Result<List<AlertGroup>> list(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser){ logger.info("login user {}, query all alertGroup", loginUser.getUserName()); return alertGroupService.queryAlertgroup(); }
248
public void testProducerSession_Invalided() throws Exception{ if (!JmsConfig.jmsTestsEnabled()) { return; } EmbeddedActiveMq activeMqBroker = new EmbeddedActiveMq(); DefinedJmsProducer producer = createProducer(new ConfiguredProduceDestination(getName())); StandaloneProducer standalone...
public void testProducerSession_Invalided() throws Exception{ EmbeddedActiveMq activeMqBroker = new EmbeddedActiveMq(); DefinedJmsProducer producer = createProducer(new ConfiguredProduceDestination(getName())); StandaloneProducer standaloneProducer = new StandaloneProducer(activeMqBroker.getJmsConnection...
249
public void beforeConnection(){ Services.registerService(IReplenishForFutureQty.class, new ReplenishForFutureQty()); Services.registerService(IInvoiceBL.class, new InvoiceBL()); Services.registerService(IInvoiceDAO.class, new InvoiceDAO()); Services.registerService(IAddonService.class, new AddonServ...
public void beforeConnection(){ Services.registerService(IReplenishForFutureQty.class, new ReplenishForFutureQty()); Services.registerService(IInvoiceBL.class, new InvoiceBL()); Services.registerService(IInvoiceDAO.class, new InvoiceDAO()); Services.registerService(IAddonService.class, new AddonServ...
250
public void resetTest() throws IOException, NoSuchFieldException, IllegalAccessException{ FakeBattery.deleteEV3DevFakeSystemPath(); FakeBattery.createEV3DevFakeSystemPath(); System.setProperty(EV3DevFileSystem.EV3DEV_TESTING_KEY, FakeBattery.EV3DEV_FAKE_SYSTEM_PATH); }
public void resetTest() throws IOException{ FakeBattery.resetEV3DevInfrastructure(); System.setProperty(EV3DevFileSystem.EV3DEV_TESTING_KEY, FakeBattery.EV3DEV_FAKE_SYSTEM_PATH); }
251
public void setStudentInfo(Scanner scanner){ LOGGER.log(Level.INFO, "Name: "); String name = scanner.next(); setName(name); LOGGER.log(Level.INFO, "Class: "); while (!scanner.hasNextInt()) { LOGGER.log(Level.WARNING, "Please provide a number :"); scanner.next(); } se...
public void setStudentInfo(Scanner scanner){ LOGGER.log(Level.INFO, "Name: "); setName(scanner.next()); LOGGER.log(Level.INFO, "Class: "); while (!scanner.hasNextInt()) { LOGGER.log(Level.WARNING, "Please provide a number :"); scanner.next(); } setStandard(scanner.nextInt...
252
public int[] readIntArray(String name, int[] defVal) throws IOException{ try { Element tmpEl; if (name != null) { tmpEl = findChildElement(currentElem, name); } else { tmpEl = currentElem; } if (tmpEl == null) { return defVal; ...
public int[] readIntArray(String name, int[] defVal) throws IOException{ try { Element tmpEl; if (name != null) { tmpEl = findChildElement(currentElem, name); } else { tmpEl = currentElem; } if (tmpEl == null) { return defVal; ...
253
public Result updateTenant(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int id, @RequestParam(value = "tenantCode") String tenantCode, @RequestParam(value = "queueId") int queueId, @RequestParam(value = "description", required = false) String description) thro...
public Result<Void> updateTenant(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int id, @RequestParam(value = "tenantCode") String tenantCode, @RequestParam(value = "queueId") int queueId, @RequestParam(value = "description", required = false) String description...
254
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...
255
private long moveBackwardsToFindAlternateRoute(){ this.isGoingBackwards = true; while (reverseNodes.isEmpty()) { nodeToGetTo = findFirstNodeWithUnusedNeighbour(); NodeImpl currentNode; if (!nodesAlreadyAttempted.contains(nodeToGetTo)) { if (nodeToGetTo != 0) { ...
private long moveBackwardsToFindAlternateRoute(){ this.isGoingBackwards = true; while (reverseNodes.isEmpty()) { nodeToGetTo = findFirstNodeWithUnusedNeighbour(); NodeImpl currentNode; if (!nodesAlreadyAttempted.contains(nodeToGetTo)) { if (nodeToGetTo != 0) { ...
256
public void getUser_RetrieveFromRemoteFail_ThenRemoteFromDB(){ userDataRepositoryImpl.getUsers("", baseLoadDataCallback); verify(userRemoteDataSource).getUsers(anyString(), loadRemoteDataCallbackArgumentCaptor.capture()); loadRemoteDataCallbackArgumentCaptor.getValue().onFail(new OperationJSONException()...
public void getUser_RetrieveFromRemoteFail_ThenRemoteFromDB(){ when(userDBDataSource.getUsers()).thenReturn(Collections.singletonList(createUser())); userDataRepositoryImpl.getUsers("", baseLoadDataCallback); verify(userRemoteDataSource).getUsers(anyString(), loadRemoteDataCallbackArgumentCaptor.capture(...
257
public void onClick(View v){ recoveryButton.setEnabled(false); mail = recoveryEmail.getText().toString().trim(); String url = "https://liborgs-1139.appspot.com/users/reset-password?"; RequestQueue queue = Volley.newRequestQueue(ForgotPassActivity.this); StringRequest request = new StringRequest...
public void onClick(View v){ recoveryButton.setEnabled(false); mail = recoveryEmail.getText().toString().trim(); RequestQueue queue = Volley.newRequestQueue(ForgotPassActivity.this); StringRequest request = new StringRequest(Request.Method.POST, Constants.PASSWORD_RESET_URL, new Response.Listener<St...
258
public ConfigFile save(MultipartFile file) throws IOException{ String fileName = file.getOriginalFilename(); String filePath = storagePath + fileName; FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath)); ConfigFile configFile = configFileRepository.findOneByFileName(fileName);...
public ConfigFile save(MultipartFile file) throws IOException{ String fileName = file.getOriginalFilename(); String filePath = storagePath + fileName; FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath)); ConfigFile configFile = configFileRepository.findOneByFileName(fileName);...
259
private void performLogOperationChecks(Collection<OperationWithCompletion> operations, DurableLog durableLog){ long lastSeqNo = -1; Iterator<Operation> logIterator = durableLog.read(-1L, operations.size() + 1, TIMEOUT).join(); verifyFirstItemIsMetadataCheckpoint(logIterator); OperationComparer compa...
private void performLogOperationChecks(Collection<OperationWithCompletion> operations, DurableLog durableLog){ long lastSeqNo = -1; Iterator<Operation> logIterator = durableLog.read(-1L, operations.size() + 1, TIMEOUT).join(); verifyFirstItemIsMetadataCheckpoint(logIterator); OperationComparer compa...
260
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key){ if (key.equals(SharedPrefsKeys.IS_RUNNING_KEY)) { boolean isRunning = SharedPrefsManager.getInstance(this).readBoolean(SharedPrefsKeys.IS_RUNNING_KEY); Log.d(LOG_TAG, "isRunning: " + isRunning); if (i...
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key){ if (key.equals(SharedPrefsKeys.IS_RUNNING_KEY)) { boolean isRunning = SharedPrefsManager.getInstance(this).readBoolean(SharedPrefsKeys.IS_RUNNING_KEY); Log.d(LOG_TAG, "isRunning: " + isRunning); if (i...
261
private List<Map<String, String>> querySource(String query, int maxResults) throws InternalErrorException, FileNotFoundException, IOException{ List<Map<String, String>> subjects = new ArrayList<>(); int index = query.indexOf("="); int indexContains = query.indexOf("contains"); if (index != -1) { ...
private void querySource(String query, int maxResults, List<Map<String, String>> subjects) throws InternalErrorException, FileNotFoundException, IOException{ int index = query.indexOf("="); int indexContains = query.indexOf("contains"); if (index != -1) { String queryType = query.substring(0, in...
262
public void end(boolean interrupted){ shooter.stopFlywheelMotor(); shooter.stopFeederMotor(); ; shooter.stopKickupMotor(); }
public void end(boolean interrupted){ shooter.stopFlywheelMotor(); }
263
public static void setType(ScreenType screenType){ Screen screen = null; for (Screen s : screens) { if (s.screenType == screenType) { screen = s; } } screens.remove(screen); screens.add(0, screen); }
public static void setType(ScreenType screenType){ Screen screen = null; for (Screen s : screens) if (s.screenType == screenType) screen = s; screens.remove(screen); screens.add(0, screen); }
264
private boolean isAnyGatewayProcessingGroupId(int groupId){ Utilities.log.debug(getClass().getName() + ":: isAnyGatewayProcessingGroupId(" + groupId + ")"); if (gateways != null) { for (int i = 0; i < gateways.size(); i++) { DummyGateway gateway = gateways.get(i); DummyMessa...
private boolean isAnyGatewayProcessingGroupId(int groupId){ Utilities.log.debug(getClass().getName() + ":: isAnyGatewayProcessingGroupId(" + groupId + ")"); if (gateways != null) { for (final DummyGateway dummyGateway : gateways) { final DummyMessage msg = dummyGateway.getLastMessageSent...
265
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ View view = inflater.inflate(R.layout.fragment_main_list, container, false); if (view instanceof RecyclerView) { Context context = view.getContext(); RecyclerView recyclerView = (RecyclerView) ...
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ View view = inflater.inflate(R.layout.fragment_main_list, container, false); if (view instanceof RecyclerView) { RecyclerView recyclerView = (RecyclerView) view; recyclerView.setLayoutManager(n...
266
public void testChangesOnStmts() throws ParseException{ String code = "public class Bar{\n public void foo() {\n String s = null;\n names.entrySet().stream().map(Map.Entry::getValue).collect(Collectors.toList());\n }\n}"; DefaultJavaParser parser = new DefaultJavaParser(); Compilation...
public void testChangesOnStmts() throws ParseException{ String code = "public class Bar{\n public void foo() {\n String s = null;\n names.entrySet().stream().map(Map.Entry::getValue).collect(Collectors.toList());\n }\n}"; DefaultJavaParser parser = new DefaultJavaParser(); Compilation...
267
public void onResponse(Call<RawEpisodesServerResponse> call, Response<RawEpisodesServerResponse> response){ listEpisodes = response.body(); SharedPreferences sharedPreferences = view.getContext().getSharedPreferences("APP_DATA", Context.MODE_PRIVATE); sharedPreferences.edit().putString("Episodes_List", g...
public void onResponse(Call<RawEpisodesServerResponse> call, Response<RawEpisodesServerResponse> response){ listEpisodes = response.body(); SharedPreferences sharedPreferences = view.getContext().getSharedPreferences("APP_DATA", Context.MODE_PRIVATE); sharedPreferences.edit().putString("Episodes_List", g...
268
protected void setSkin(Skin skin){ if (skin == null) { throw new IllegalArgumentException("skin is null."); } if (this.skin != null) { throw new IllegalStateException("Skin is already installed."); } this.skin = skin; styles = new BeanAdapter(skin); skin.install(this...
protected void setSkin(Skin skin){ Utils.checkNull(skin, "skin"); if (this.skin != null) { throw new IllegalStateException("Skin is already installed."); } this.skin = skin; styles = new BeanAdapter(skin); skin.install(this); LinkedList<Class<?>> styleTypes = new LinkedList<>...
269
public void setUp(){ mMainThread = new TestMainThread(); FakeDaoModule daoModule = new FakeDaoModule(); daoModule.setSeriesDao(mSeriesDao); daoModule.setEpisodeDao(mEpisodeDao); FakeNetworkRepositoryModule networkRepositoryModule = new FakeNetworkRepositoryModule(); InteractorComponent com...
public void setUp(){ FakeDaoModule daoModule = new FakeDaoModule(); daoModule.setSeriesDao(mSeriesDao); daoModule.setEpisodeDao(mEpisodeDao); FakeNetworkRepositoryModule networkRepositoryModule = new FakeNetworkRepositoryModule(); InteractorComponent component = DaggerInteractorComponent.builde...
270
protected ApiRequest pkInit(){ Wrap<Long> pkWrap = new Wrap<Long>().var("pk").o(pk); if (pk == null) { _pk(pkWrap); setPk(pkWrap.o); } pkWrap.o(null); return (ApiRequest) this; }
protected ApiRequest pkInit(){ Wrap<Long> pkWrap = new Wrap<Long>().var("pk"); if (pk == null) { _pk(pkWrap); setPk(pkWrap.o); } return (ApiRequest) this; }
271
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabl...
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabl...
272
public ResponseEntity<Object> getDocumentBinaryContent(UUID documentId){ try { final HttpEntity requestEntity = new HttpEntity(getHttpHeaders()); String documentBinaryUrl = String.format("%s/documents/%s/binary", documentURL, documentId); ResponseEntity<ByteArrayResource> response = rest...
public ResponseEntity<Object> getDocumentBinaryContent(UUID documentId){ try { final HttpEntity requestEntity = new HttpEntity(getHttpHeaders()); String documentBinaryUrl = String.format("%s/documents/%s/binary", documentURL, documentId); ResponseEntity<ByteArrayResource> response = rest...
273
public boolean onNavigationItemSelected(MenuItem item){ int id = item.getItemId(); if (id == R.id.nav_sign_out) { viewModel.clearAccessTokens(); finish(); } drawer.closeDrawer(GravityCompat.START); return true; }
public boolean onNavigationItemSelected(MenuItem item){ int id = item.getItemId(); if (id == R.id.nav_sign_out) { viewModel.clearAccessTokens(); } drawer.closeDrawer(GravityCompat.START); return true; }
274
public Expression optimize(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException{ StaticContext env = visitor.getStaticContext(); Optimizer opt = visitor.getConfiguration().getOptimizer(); if (action instanceof VariableReference && ((VariableReference) action).getBinding() == this) {...
public Expression optimize(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException{ StaticContext env = visitor.getStaticContext(); if (action instanceof VariableReference && ((VariableReference) action).getBinding() == this) { return visitor.optimize(sequence, contextItemType); ...
275
private void updateList(){ if (!listFriends.isEmpty()) { adapter = new FriendAdapter(FriendActivity.this, R.layout.friend_list_component, listFriends); lvFriends.setAdapter(adapter); } }
private void updateList(){ adapter = new FriendAdapter(FriendActivity.this, R.layout.friend_list_component, listFriends); lvFriends.setAdapter(adapter); }
276
private int unlockTable(UnlockTableDesc unlockTbl) throws HiveException{ Context ctx = driverContext.getCtx(); HiveTxnManager txnManager = ctx.getHiveTxnManager(); if (!txnManager.supportsExplicitLock()) { throw new HiveException(ErrorMsg.LOCK_REQUEST_UNSUPPORTED, conf.getVar(HiveConf.ConfVars.H...
private int unlockTable(UnlockTableDesc unlockTbl) throws HiveException{ Context ctx = driverContext.getCtx(); HiveTxnManager txnManager = ctx.getHiveTxnManager(); return txnManager.unlockTable(db, unlockTbl); }
277
private LiveData<Message> getResultReading(){ return Transformations.map(mResultReader, input -> { Message message = null; if (input.data.getFields().getCode() != AudioTagger.SUCCESS) { if (input.data.getFields().getError().getMessage() != null) message = new Message...
private LiveData<Message> getResultReading(){ return Transformations.map(mResultReader, input -> { Message message = null; if (input.data.getFields().getCode() != AudioTagger.SUCCESS) { if (input.data.getFields().getError().getMessage() != null) message = new Message...
278
public Result batchDeleteProcessInstanceByIds(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable String projectName, @RequestParam("processInstanceIds") String processInstanceIds){ logger.info("delete process instance by ids, login user:{}, project name:{}, process instance ids :{}", l...
public Result<Void> batchDeleteProcessInstanceByIds(@RequestAttribute(value = Constants.SESSION_USER) User loginUser, @PathVariable String projectName, @RequestParam("processInstanceIds") String processInstanceIds){ logger.info("delete process instance by ids, login user:{}, project name:{}, process instance ids :...
279
public void testMapRowTo4() throws Exception{ ColumnMapper<SampleJavaBean> mapper = mock(ColumnMapper.class); when(mapper.classTag()).thenReturn(JavaApiHelper.getClassTag(SampleJavaBean.class)); RowReaderFactory<SampleJavaBean> rrf = mapRowTo(mapper); assertThat(rrf, instanceOf(ClassBasedRowReaderFa...
public void testMapRowTo4() throws Exception{ ColumnMapper<SampleJavaBean> mapper = mock(ColumnMapper.class); RowReaderFactory<SampleJavaBean> rrf = mapRowTo(SampleJavaBean.class, mapper); assertThat(rrf, instanceOf(ClassBasedRowReaderFactory.class)); assertThat(rrf.targetClass().getName(), is(Sampl...
280
public VPStateBuilder<ACTION> createEmptyStateBuilder(){ final VPStateBuilder<ACTION> builder = new VPStateBuilder<>(mDomain); for (final EqGraphNode<EqNode, IProgramVarOrConst> egn : builder.getAllEqGraphNodes()) { egn.setupNode(); } final Set<EqNode> literalSet = mDomain.getLiteralEqNodes...
public VPStateBuilder<ACTION> createEmptyStateBuilder(){ final Set<EqNode> literalSet = mDomain.getLiteralEqNodes(); final Set<VPDomainSymmetricPair<EqNode>> disEqualitySet = new HashSet<>(); for (final EqNode node1 : literalSet) { for (final EqNode node2 : literalSet) { if (!node1....
281
public boolean contains(User user){ synchronized (this) { for (KonThread thread : mMap.values()) { Set<User> threadUser = thread.getUser(); if (threadUser.size() == 1 && threadUser.contains(user)) return true; } } return false; }
public boolean contains(User user){ return this.getOrNull(user) != null; }
282
public Result delUserById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int id) throws Exception{ logger.info("login user {}, delete user, userId: {},", loginUser.getUserName(), id); Map<String, Object> result = usersService.deleteUserById(loginUser, ...
public Result<Void> delUserById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "id") int id) throws Exception{ logger.info("login user {}, delete user, userId: {},", loginUser.getUserName(), id); return usersService.deleteUserById(loginUser, id); }
283
private List<Map<String, String>> executeQueryTypeGroupSubjects(String value, int maxResults) throws InternalErrorException{ List<Map<String, String>> subjects = new ArrayList<>(); if (value.contains("@" + this.domainName)) { try { Members result = service.members().list(value).execute()...
private void executeQueryTypeGroupSubjects(String value, int maxResults, List<Map<String, String>> subjects) throws InternalErrorException{ if (value.contains("@" + this.domainName)) { try { Members result = service.members().list(value).execute(); List<Member> membersInGroup = r...
284
private void updateModel(){ if (this.rocketModel == null) { ModelResourceLocation modelResourceLocation = new ModelResourceLocation(Constants.TEXTURE_PREFIX + "electric_rocket", "inventory"); this.rocketModel = (ItemModelRocketElectricRocket) MCUtilities.getClient().getRenderItem().getItemModelMe...
private void updateModel(){ if (this.rocketModel == null) { this.rocketModel = (ItemModelRocketElectricRocket) ModelUtilities.getModelFromRegistry(Constants.TEXTURE_PREFIX, "electric_rocket"); } }
285
private EObject getEObjectFor(String string){ EClassifier eClassifier = Ifc4Package.eINSTANCE.getEClassifier(string); EObject eObject = null; if (eClassifier instanceof EClass) { eObject = EcoreUtil.create((EClass) eClassifier); } this.toString(eClassifier); return eObject; }
private EObject getEObjectFor(String string){ EClassifier eClassifier = Ifc4Package.eINSTANCE.getEClassifier(string); EObject eObject = null; if (eClassifier instanceof EClass) { eObject = EcoreUtil.create((EClass) eClassifier); } return eObject; }
286
public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); if (getArguments() != null) { mNoteIndex = getArguments().getString(ARG_PARAM1); mTabPosition = getArguments().getString(ARG_PARAM2); } }
public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); if (getArguments() != null) { mNoteIndex = getArguments().getString(ARG_NOTE_INDEX); } }
287
public List<Permanent> getActivePermanents(FilterPermanent filter, UUID sourcePlayerId, UUID sourceId, Game game){ if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { return field.values().stream().filter(perm -> perm.isPhasedIn() && filter.match(perm, sourceId, sourcePlayerId, game)).collect(Collec...
public List<Permanent> getActivePermanents(FilterPermanent filter, UUID sourcePlayerId, UUID sourceId, Game game){ if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { return field.values().stream().filter(perm -> perm.isPhasedIn() && filter.match(perm, sourceId, sourcePlayerId, game)).collect(Collec...
288
public Map<String, Object> previewSchedule(User loginUser, String projectName, String schedule){ Map<String, Object> result = new HashMap<>(); CronExpression cronExpression; ScheduleParam scheduleParam = JSONUtils.parseObject(schedule, ScheduleParam.class); Date now = new Date(); Date startTime...
public Result<List<String>> previewSchedule(User loginUser, String projectName, String schedule){ Map<String, Object> result = new HashMap<>(); CronExpression cronExpression; ScheduleParam scheduleParam = JSONUtils.parseObject(schedule, ScheduleParam.class); Date now = new Date(); Date startTim...
289
private Path generateTempFileFor(Path dest, Path video){ try { return Files.createTempFile(dest.getParent(), dest.getFileName().toString(), "." + FilenameUtils.getExtension(video.getFileName().toString())); } catch (IOException e) { log.error("Error during generation of tmp file for {}", vid...
private Path generateTempFileFor(Path dest, Path video){ return Try.of(() -> Files.createTempFile(dest.getParent(), dest.getFileName().toString(), "." + FilenameUtils.getExtension(video.getFileName().toString()))).onFailure(e -> log.error("Error during generation of tmp file for {}", video.toAbsolutePath().toStrin...
290
private List<Map<String, String>> executeQueryTypeEmail(String value, int maxResults) throws InternalErrorException{ List<Map<String, String>> subjects = new ArrayList<>(); try { Members result = service.members().list(groupName).execute(); List<Member> membersInGroup = result.getMembers(); ...
private void executeQueryTypeEmail(String value, int maxResults, List<Map<String, String>> subjects) throws InternalErrorException{ try { Members result = service.members().list(groupName).execute(); List<Member> membersInGroup = result.getMembers(); for (Member member : membersInGroup) ...
291
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); ctx = this; mainActivityRunningInstance = this; DrawerLayout drawer = (...
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); ctx = this; DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_la...
292
public Response registerResearcher(@PathParam("userId") Integer userId, NIHUserAccount nihAccount){ try { ; return Response.status(Response.Status.OK).entity(nihAuthApi.authenticateNih(nihAccount, userId)).build(); } catch (Exception e) { return createExceptionResponse(e); } }
public Response registerResearcher(@PathParam("userId") Integer userId, NIHUserAccount nihAccount){ try { return Response.status(Response.Status.OK).entity(nihAuthApi.authenticateNih(nihAccount, userId)).build(); } catch (Exception e) { return createExceptionResponse(e); } }
293
public static PinpointManager getPinpointManager(final Context applicationContext){ if (pinpointManager == null) { final AWSConfiguration awsConfig = new AWSConfiguration(applicationContext); AWSMobileClient.getInstance().initialize(applicationContext, awsConfig, new Callback<UserStateDetails>() ...
public static PinpointManager getPinpointManager(final Context applicationContext){ if (pinpointManager == null) { final AWSConfiguration awsConfig = new AWSConfiguration(applicationContext); AWSMobileClient.getInstance().initialize(applicationContext, awsConfig, new Callback<UserStateDetails>() ...
294
public List<Map<String, Object>> items(@PathVariable String table){ LOGGER.info("Getting items for " + table); List<Map<String, Object>> items = new ArrayList<>(); ScanRequest scanRequest = new ScanRequest().withTableName(table); try { List<Map<String, AttributeValue>> list = amazonDynamoDB...
public List<Map<String, Object>> items(@PathVariable String table){ LOGGER.info("Getting items for " + table); List<Map<String, Object>> items = new ArrayList<>(); scanRequest.withTableName(table); List<Map<String, AttributeValue>> list = amazonDynamoDBClient.scan(scanRequest).getItems(); LOGGE...
295
public static void unZip(String zipFile, String outputFolder){ byte[] buffer = new byte[1024]; try { File folder = new File(outputFolder); if (!folder.exists()) { folder.mkdir(); } ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFile)); ...
public static void unZip(String zipFile, String outputFolder){ byte[] buffer = new byte[1024]; try { File folder = new File(outputFolder); if (!folder.exists()) { folder.mkdir(); } ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFile)); ...
296
public Bitmap GetBarcode(int width, int height){ Code39Writer writer = new Code39Writer(); BitMatrix bm = null; Bitmap bitmap = null; try { bm = writer.encode(content, BarcodeFormat.CODE_39, width, height); } catch (WriterException e) { e.printStackTrace(); } if (bm ...
public Bitmap GetBarcode(int width, int height){ return ProduceBarcode(new Code39Writer(), BarcodeFormat.CODE_39, width, height); }
297
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); recyclerView = findViewById(R.id.recycler); stockAdapter = new StockAdapter(stockList, this); recyclerView.setAdapter(stockAdapter); recyclerView.setLayoutManager...
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); recyclerView = findViewById(R.id.recycler); stockAdapter = new StockAdapter(stockList, this); recyclerView.setAdapter(stockAdapter); recyclerView.setLayoutManager...
298
public static void collectNestedProperties(T initial, NestedPropertyContext<T> context){ Queue<T> queue = new ArrayDeque<T>(); queue.add(initial); while (!queue.isEmpty()) { T nestedNode = queue.remove(); if (context.isIterable(nestedNode)) { Iterators.addAll(queue, nestedN...
public static void collectNestedProperties(T initial, NestedPropertyContext<T> context){ Queue<T> queue = new ArrayDeque<T>(); queue.add(initial); while (!queue.isEmpty()) { T nestedNode = queue.remove(); if (!(context.shouldUnpack(nestedNode) && nestedNode.unpackToQueue(queue))) { ...
299
private void deleteGroups(){ Collection<Group> groups = getSelectedGroups(); for (Iterator<Group> iterator = groups.iterator(); iterator.hasNext(); ) { Group group = iterator.next(); group = groupService.merge(group); Set<User> users = new HashSet<>(); users.addAll(group.ge...
private void deleteGroups(){ Collection<Group> groups = getSelectedGroups(); for (Group group : groups) { group = groupService.merge(group); Set<User> users = new HashSet<>(); users.addAll(group.getUsers()); groupService.delete(group); for (User user : users) { ...