Unnamed: 0 int64 0 9.45k | cwe_id stringclasses 1
value | source stringlengths 37 2.53k | target stringlengths 19 2.4k |
|---|---|---|---|
800 | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
initViewModel();
userSelectednewsSources = prepareHashmap();
for (Map.Entry<String, String> entry : userSel... | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
initViewModel();
userSelectednewsSources = prepareHashmap();
for (Map.Entry<String, String> entry : userSel... | |
801 | public Object parse(String rawData) throws SettingsParserException{
try {
JSONParser parser = new JSONParser();
JSONObject devInfo = (JSONObject) parser.parse(rawData);
return devInfo;
} catch (ParseException | NullPointerException | ClassCastException ex) {
throw new Setti... | public Object parse(String rawData) throws SettingsParserException{
try {
JSONParser parser = new JSONParser();
return parser.parse(rawData);
} catch (ParseException | NullPointerException | ClassCastException ex) {
throw new SettingsParserException(ex.getMessage());
}
} | |
802 | public static String getAdhocQuery(String module){
InputStream is = null;
InputStreamReader reader = null;
StringWriter writer = null;
try {
is = TaskFactory.class.getResourceAsStream("/" + module);
if (is == null) {
File f = new File(module);
if (f.exists... | public static String getAdhocQuery(String module){
try {
InputStream is = TaskFactory.class.getResourceAsStream("/" + module);
if (is == null) {
File f = new File(module);
if (f.exists() && !f.isDirectory()) {
is = new FileInputStream(f);
} ... | |
803 | public Player[] askPlayer(Action action, Player player){
Player[] players = new Player[2];
final Card random = getNextCard(true);
switch(action) {
case STAND:
player.getAction().stand(player);
standbyPlayers.add(player);
break;
case HIT:
... | public void askPlayer(Action action, Player player){
final Card random = getNextCard(true);
switch(action) {
case STAND:
player.getAction().stand(player);
standbyPlayers.add(player);
break;
case HIT:
Result hit_result = player.getAction().h... | |
804 | public void configure() throws Exception{
log.debug("Configuring route '{}'.", routeId);
String selector = "?selector=" + java.net.URLEncoder.encode(MpfHeaders.JMS_REPLY_TO + "='" + MpfEndpoints.COMPLETED_DETECTIONS_REPLY_TO + "'", "UTF-8");
from(entryPoint + selector).routeId(routeId).setExchangePattern... | public void configure() throws Exception{
log.debug("Configuring route '{}'.", routeId);
String selector = "?selector=" + java.net.URLEncoder.encode(MpfHeaders.JMS_REPLY_TO + "='" + MpfEndpoints.COMPLETED_DETECTIONS_REPLY_TO + "'", "UTF-8");
from(entryPoint + selector).routeId(routeId).setExchangePattern... | |
805 | public void dropTable(String tableName){
Preconditions.checkNotNull(tableName);
Preconditions.checkArgument(tableName.toUpperCase().startsWith(ExtractionDao.TABLE_NAME_PREFIX) || tableName.toUpperCase().startsWith(AggregationDao.TABLE_NAME_PREFIX));
log.debug(String.format("Dropping extraction table {%s}... | public void dropTable(String tableName){
Preconditions.checkNotNull(tableName);
Preconditions.checkArgument(tableName.toUpperCase().startsWith(ExtractionDao.TABLE_NAME_PREFIX) || tableName.toUpperCase().startsWith(AggregationDao.TABLE_NAME_PREFIX));
super.dropTable(tableName);
} | |
806 | public static boolean isEmpty(String s){
if (s == null) {
return true;
}
return s.trim().equals("");
} | public static boolean isEmpty(String s){
return com.navercorp.cubridqa.common.CommonUtils.isEmpty(s);
} | |
807 | private void urlSubmit(){
String url = formatter.formatURL(urlField.getText());
if (formatter.validateURL(url)) {
boolean estConnection = false;
try {
estConnection = formatter.pingURL(url);
} catch (IOException e) {
monitor.error("Unable to connect to the ... | private void urlSubmit(){
String url = formatter.formatURL(urlField.getText());
if (formatter.validateURL(url)) {
boolean estConnection = false;
try {
estConnection = formatter.pingURL(url);
} catch (IOException e) {
dataManager.error("Unable to connect to ... | |
808 | public LocalMapStats getLocalMapStats(){
initNearCache();
LocalMapStatsImpl localMapStats = new LocalMapStatsImpl();
if (nearCache != null) {
localMapStats.setNearCacheStats(nearCache.getNearCacheStats());
}
return localMapStats;
} | public LocalMapStats getLocalMapStats(){
return new LocalMapStatsImpl();
} | |
809 | private void deepCopyList(List<Type> types){
expenseTypeList = new ImmutableList.Builder<String>().build();
incomeTypeList = new ImmutableList.Builder<String>().build();
ImmutableList.Builder<String> expenseTypeBuilder = new ImmutableList.Builder<>();
ImmutableList.Builder<String> incomeTypeBuilder ... | private void deepCopyList(List<String> tempExpenseTypes, List<String> tempIncomeTypes){
expenseTypeList = ImmutableList.copyOf(tempExpenseTypes);
incomeTypeList = ImmutableList.copyOf(tempIncomeTypes);
boolean isExpenseType = updateRadioButton();
ArrayAdapter<String> adapterType = showSpinnerType(is... | |
810 | private UploadResult uploadTo(UploadDirectory yandexDiskUploadDirectory, MultipartFile file, String fileHash){
if (!hasEnoughSpaceToUploadTo(yandexDiskUploadDirectory, file)) {
return new UploadResult(UploadStatus.FAILURE, "Not enough space to upload file: " + file.getOriginalFilename() + "\n");
}
... | private UploadResult uploadTo(UploadDirectory yandexDiskUploadDirectory, MultipartFile file, String fileHash){
final UserLogin userLogin = yandexDiskUploadDirectory.getUserLogin();
final String filename = StringUtils.cleanPath(file.getOriginalFilename());
final Path localFilePath = storageService.store(f... | |
811 | public void should_print_product_tails_information(){
List<LineItem> lineItems = new ArrayList<LineItem>() {
{
add(new LineItem("巧克力", 21.50, 2));
add(new LineItem("小白菜", 10.00, 1));
}
};
OrderReceipt receipt = new OrderReceipt(new Order(null, null, lineItems... | public void should_print_product_tails_information(){
List<LineItem> lineItems = new ArrayList<LineItem>() {
{
add(new LineItem("巧克力", 21.50, 2));
add(new LineItem("小白菜", 10.00, 1));
}
};
OrderReceipt receipt = new OrderReceipt(new Order(lineItems, LocalDate.... | |
812 | public AuditRequest<AuditedRequest, AuditedRequestContext> startSyncAudit(final AuditedRequest request, final AuditedRequestContext ctx){
final AuditRequest<AuditedRequest, AuditedRequestContext> wrappedRequest = new AuditRequest<AuditedRequest, AuditedRequestContext>();
wrappedRequest.setRequest(request);
... | public AuditRequest<AuditedRequest, AuditedRequestContext> startSyncAudit(final AuditedRequest request, final AuditedRequestContext ctx){
final AuditRequest<AuditedRequest, AuditedRequestContext> wrappedRequest = createAuditRequest(request, ctx);
logger.warn("start sync audit {}", wrappedRequest.toString());
... | |
813 | public List<ExtremelySimplifiedResource> defaultGetResourceList(Exchange exchange, @Header("sortBy") String sortBy, @Header("sortOrder") String sortOrder, @Header("pageSize") String pageSize, @Header("page") String page) throws ESRPaginationException, ResourceInvalidSortException, ResourceInvalidSearchException, ESRSor... | public List<ExtremelySimplifiedResource> defaultGetResourceList(Exchange exchange, @Header("sortBy") String sortBy, @Header("sortOrder") String sortOrder, @Header("pageSize") String pageSize, @Header("page") String page) throws ESRPaginationException, ResourceInvalidSortException, ResourceInvalidSearchException, ESRSor... | |
814 | public void testSchema() throws Exception{
boolean isSchemaGood = schemaResource.confirmSchema();
if (!isSchemaGood) {
schemaResource.deleteSchema();
isSchemaGood = schemaResource.confirmSchema();
assertFalse(isSchemaGood);
schemaResource.createSchema();
isSchemaGo... | public void testSchema() throws Exception{
if (!schemaResource.confirmSchema()) {
schemaResource.deleteSchema();
assertFalse(schemaResource.confirmSchema());
schemaResource.createSchema();
assertTrue(schemaResource.confirmSchema());
}
} | |
815 | public final boolean equals(final Object o){
if (Arez.areNativeComponentsEnabled()) {
if (this == o) {
return true;
} else if (null == o || !(o instanceof Arez_UnsafeSpecificProcedureActionModel)) {
return false;
} else {
final Arez_UnsafeSpecificPr... | public final boolean equals(final Object o){
if (Arez.areNativeComponentsEnabled()) {
if (o instanceof Arez_UnsafeSpecificProcedureActionModel) {
final Arez_UnsafeSpecificProcedureActionModel that = (Arez_UnsafeSpecificProcedureActionModel) o;
return this.$$arezi$$_id() == that.$... | |
816 | 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);
... | |
817 | private void getInstalledOs(SQLConnection connection, Handler<AsyncResult<List<JsonObject>>> next){
String query = "SELECT * FROM app_installer";
connection.query(query, selectHandler -> {
if (selectHandler.failed()) {
handleFailure(logger, selectHandler);
} else {
... | private void getInstalledOs(SQLConnection connection, Handler<AsyncResult<List<JsonObject>>> next){
connection.query(SELECT_APP_INSTALLER_QUERY, selectHandler -> {
if (selectHandler.failed()) {
handleFailure(logger, selectHandler);
} else {
logger.info("Installed OS: ", ... | |
818 | public Vector<Record> searchRecords(Collection collection, String searchterm, int end){
Vector<Record> records = new Vector<Record>();
_cache.last_num_results = 0;
if (collection == null) {
ContentValues values = new ContentValues();
Cursor cursor = _db.rawQuery("select * from \"" + _re... | public Vector<Record> searchRecords(Collection collection, String searchterm, int end){
Vector<Record> records = new Vector<Record>();
_cache.last_num_results = 0;
if (collection == null) {
ContentValues values = new ContentValues();
Cursor cursor = _db.rawQuery("select * from \"" + _re... | |
819 | public static void deleteMessage(Context context, Uri messageUri){
ContentResolver contentResolver = context.getContentResolver();
int deletedRows = contentResolver.delete(messageUri, null, null);
if (deletedRows == 0) {
Xlog.e(TAG, "Writing to SMS inbox failed, does app have OP_WRITE_SMS permis... | public static void deleteMessage(Context context, Uri messageUri){
ContentResolver contentResolver = context.getContentResolver();
int deletedRows = contentResolver.delete(messageUri, null, null);
if (deletedRows == 0) {
Xlog.e(TAG, "URI does not match any message in SMS inbox");
}
} | |
820 | public String getPlayersWithHighestAverages() throws IPLAnalyserException{
String pathForBatsmanAverage = "E:\\Mayur Zope Contents\\Downloads\\IPLAnalyser\\src\\test\\resources\\IPLBattingAverage.json";
try (Writer writer = new FileWriter(pathForBatsmanAverage)) {
if (iplCSVList == null || iplCSVList... | public String getPlayersWithHighestAverages() throws IPLAnalyserException{
String pathForBatsmanAverage = "E:\\Mayur Zope Contents\\Downloads\\IPLAnalyser\\src\\test\\resources\\IPLBattingAverage.json";
try (Writer writer = new FileWriter(pathForBatsmanAverage)) {
checkIPLCSVList();
Comparat... | |
821 | public void zinterstore(final byte[] dstkey, final byte[]... sets){
final byte[][] params = new byte[sets.length + 2][];
params[0] = dstkey;
params[1] = Protocol.toByteArray(sets.length);
System.arraycopy(sets, 0, params, 2, sets.length);
sendCommand(ZINTERSTORE, params);
} | public void zinterstore(final byte[] dstkey, final byte[]... sets){
sendCommand(ZINTERSTORE, joinParameters(dstkey, Protocol.toByteArray(sets.length), sets));
} | |
822 | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_post);
initUi();
initToolbar();
volleyQueue = Volley.newRequestQueue(this);
setPostFab();
type = TYPE_NEWS;
typeRd.setOnCheckedChangeListener(new RadioGroup.On... | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_post);
initUi();
initToolbar();
setPostFab();
volleyQueue = Volley.newRequestQueue(this);
type = TYPE_NEWS;
} | |
823 | public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{
String username = (String) request.getSession().getAttribute("user");
if (username == null) {
response.sendRedirect("/login");
return;
}
User user = userStore.getUser(... | public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{
String username = (String) request.getSession().getAttribute("user");
if (username == null) {
response.sendRedirect("/login");
return;
}
User user = userStore.getUser(... | |
824 | public static void addComponentsToFields(List<AbstractComponent> applicationFields, List<ComponentDto> componentDtos){
for (ComponentDto cp : componentDtos) {
if (applicationFields.stream().noneMatch(abstractComponent -> abstractComponent.getId().equals(cp.getId()))) {
if (cp.getType().equals... | public static void addComponentsToFields(Set<AbstractComponent> applicationFields, List<ComponentDto> componentDtos){
for (ComponentDto cp : componentDtos) {
if (cp.getType().equals("QuestionScr")) {
applicationFields.add(Facade.questFacade(cp));
} else if (cp.getType().equals("Strin... | |
825 | public boolean applyChanges(){
boolean valid = true;
String timeoutValue = ((JTextField) components.get("connectionTimeout")).getText();
String threadValue = ((JTextField) components.get("threadsToUse")).getText();
String pingValue = ((JCheckBox) components.get("displayPing")).isSelected() ? "true" ... | public boolean applyChanges(){
boolean valid = true;
String timeoutValue = ((JTextField) components.get("connectionTimeout")).getText();
String threadValue = ((JTextField) components.get("threadsToUse")).getText();
String pingValue = ((JCheckBox) components.get("displayPing")).isSelected() ? "true" ... | |
826 | private JTree buildTree(){
DefaultMutableTreeNode parentNode = new DefaultMutableTreeNode();
JTree tree = new JTree(parentNode, false);
tree.setRootVisible(false);
tree.setShowsRootHandles(true);
tree.setBorder(BorderFactory.createLineBorder(Color.black));
DefaultTreeCellRenderer renderer ... | private JTree buildTree(){
DefaultMutableTreeNode parentNode = new DefaultMutableTreeNode();
JTree tree = new JTree(parentNode, false);
tree.setRootVisible(false);
tree.setShowsRootHandles(true);
tree.setBorder(BorderFactory.createLineBorder(Color.black));
DefaultTreeCellRenderer renderer ... | |
827 | public void execute(CommandSender sender, ICommandArguments args) throws CommandException{
String leaderboardName = args.getName("leaderboardName");
Leaderboard leaderboard = getLeaderboard(sender, leaderboardName);
if (leaderboard == null)
return;
if (!LeaderboardsModule.getModule().remove... | public void execute(CommandSender sender, ICommandArguments args) throws CommandException{
String leaderboardName = args.getName("leaderboardName");
Leaderboard leaderboard = getLeaderboard(sender, leaderboardName);
if (leaderboard == null)
return;
if (!LeaderboardsModule.getModule().remove... | |
828 | public ByteBuf serialize() throws SerializationException{
ByteBufAllocator allocator = getAllocator();
ByteBuf buf = super.serialize();
try {
ByteBuf res = allocator.buffer(buf.readableBytes() + 16 + 4);
res.writeBytes(buf);
res.writeBytes(certMD5);
res.writeBytes(END_... | public ByteBuf serialize(ByteBufAllocator allocator) throws SerializationException{
ByteBuf buf = super.serialize(allocator);
try {
ByteBuf res = allocator.buffer(buf.readableBytes() + 16 + 4);
res.writeBytes(buf);
res.writeBytes(certMD5);
res.writeBytes(END_MARK);
... | |
829 | public int getMonitorGraphInterval(long testId, String targetIP, int imageWidth){
File monitorDataFile = new File(config.getHome().getPerfTestReportDirectory(String.valueOf(testId)), MONITOR_FILE_PREFIX + targetIP + ".data");
int pointCount = Math.max(imageWidth, MAX_POINT_COUNT);
int interval = 0;
... | public int getMonitorGraphInterval(long testId, String targetIP, int imageWidth){
File monitorDataFile = new File(config.getHome().getPerfTestReportDirectory(String.valueOf(testId)), MONITOR_FILE_PREFIX + targetIP + ".data");
int pointCount = Math.max(imageWidth, MAX_POINT_COUNT);
int interval = 0;
... | |
830 | public Map<String, Object> queryProcessDefinitionList(User loginUser, String projectName){
HashMap<String, Object> result = new HashMap<>();
Project project = projectMapper.queryByName(projectName);
Map<String, Object> checkResult = projectService.checkProjectAndAuth(loginUser, project, projectName);
... | public Result<List<ProcessDefinition>> queryProcessDefinitionList(User loginUser, String projectName){
Project project = projectMapper.queryByName(projectName);
CheckParamResult checkParamResult = projectService.checkProjectAndAuth(loginUser, project, projectName);
if (!Status.SUCCESS.equals(checkParamRe... | |
831 | ResponseAlbumDto createAlbum(final RequestAlbumDto requestAlbumDto){
Album album = Album.builder().title(requestAlbumDto.getTitle()).content(requestAlbumDto.getContent()).build();
Album savedAlbum = albumRepository.save(album);
ResponseAlbumDto dto = modelMapperUtils.map(savedAlbum, ResponseAlbumDto.cla... | ResponseAlbumDto createAlbum(final RequestAlbumDto requestAlbumDto){
Album album = Album.builder().title(requestAlbumDto.getTitle()).content(requestAlbumDto.getContent()).build();
Album savedAlbum = albumRepository.save(album);
return modelMapperUtils.map(savedAlbum, ResponseAlbumDto.class);
} | |
832 | public String getparentStandardType(){
COSObject parent = ((org.verapdf.pd.structure.PDStructElem) simplePDObject).getParent();
if (parent != null) {
StructureType type = StructureType.createStructureType(parent.getKey(ASAtom.S), parent.getKey(ASAtom.NS));
if (type != null) {
re... | public String getparentStandardType(){
org.verapdf.pd.structure.PDStructElem parent = ((org.verapdf.pd.structure.PDStructElem) simplePDObject).getParent();
if (parent != null) {
return getStructureElementStandardType(parent);
}
return null;
} | |
833 | public void givenMultipleRides_shouldReturnTotalFare(){
InvoiceGenerator invoiceGenerator = new InvoiceGenerator();
Ride[] rides = { new Ride(2.0, 1), new Ride(0.1, 1) };
double fare = invoiceGenerator.calculateFare(rides);
Assert.assertEquals(26, fare, 0.0);
} | public void givenMultipleRides_shouldReturnTotalFare(){
Ride[] rides = { new Ride(2.0, 1), new Ride(0.1, 1) };
double fare = invoiceGenerator.calculateFare(rides);
Assert.assertEquals(26, fare, 0.0);
} | |
834 | protected void onCreate(final Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_movie_details);
ButterKnife.bind(this);
initializePosterImageView();
final Intent intent = getIntent();
if (null != intent && intent.hasExtra(EXTRA_MOVIE)) {
... | protected void onCreate(final Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_movie_details);
ButterKnife.bind(this);
initializePosterImageView();
final Intent intent = getIntent();
if (null != intent && intent.hasExtra(EXTRA_MOVIE)) {
... | |
835 | public String getMaxChangeDate(){
List<Scope> response = null;
String data = null;
try {
response = projectRepo.getProjectMaxChangeDate(featureCollectorRepository.findByName("VersionOne").getId(), featureSettings.getDeltaStartDate());
if (response.size() > 0) {
data = respo... | public String getMaxChangeDate(){
String data = null;
try {
List<Scope> response = projectRepo.getProjectMaxChangeDate(featureCollectorRepository.findByName("VersionOne").getId(), featureSettings.getDeltaStartDate());
if (!response.isEmpty()) {
data = response.get(0).getChangeDa... | |
836 | public Response intercept(Chain chain) throws IOException{
Response origResponse = chain.proceed(chain.request());
if (PreferencesWorker.getInstance().getCookies().isEmpty() && !origResponse.headers("Set-Cookie").isEmpty()) {
HashSet<String> cookies = new HashSet<>();
for (String header : or... | public Response intercept(Chain chain) throws IOException{
Response origResponse = chain.proceed(chain.request());
if (!origResponse.headers("Set-Cookie").isEmpty()) {
List<String> headers = origResponse.headers("Set-Cookie");
Log.d("OkHTTP", "Received cookie : " + headers);
Prefere... | |
837 | public Map<T, Set<Object>> removeAll(CharID id){
Map<T, Set<Object>> componentMap = getCachedMap(id);
if (componentMap == null) {
return Collections.emptyMap();
}
removeCache(id);
for (T obj : componentMap.keySet()) {
fireDataFacetChangeEvent(id, obj, DataFacetChangeEvent.DATA... | public Map<T, Set<Object>> removeAll(CharID id){
Map<T, Set<Object>> componentMap = getCachedMap(id);
if (componentMap == null) {
return Collections.emptyMap();
}
removeCache(id);
componentMap.keySet().forEach(obj -> fireDataFacetChangeEvent(id, obj, DataFacetChangeEvent.DATA_REMOVED))... | |
838 | public void setUp(){
workItemRepository = new InMemoryWorkItemRepository();
CreateWorkItemUseCase createWorkItemUseCase = new CreateWorkItemUseCase(workItemRepository);
CreateWorkItemInput createWorkItemInput = new CreateWorkItemInput("first work item");
CreateWorkItemOutput createWorkItemOutput = n... | public void setUp(){
workItemRepository = new InMemoryWorkItemRepository();
workItemId = Utility.createWorkItem(workItemRepository, "first work item");
stageRepository = new InMemoryStageRepository();
backlogId = Utility.createStage(stageRepository, 1, "Backlog");
backlog = stageRepository.find... | |
839 | public static boolean isBasicOperation(final String operation){
if (operation.length() > 8) {
return false;
}
for (int i = 0; i < Function.TYPES.REGISTER.length; ++i) {
if (Function.TYPES.REGISTER[i].equals(operation)) {
return true;
}
}
return false;
} | public static boolean isBasicOperation(final String operation){
if (operation.length() > 8)
return false;
if (Function.TYPES.LOOKUP.get(operation) != null)
return true;
return false;
} | |
840 | protected Boolean doInBackground(Void... voids){
Boolean successfulQuery = false;
Call<FilmLocation> locationCall = filmTourApplication.getService().postFilmLocation(token, newFilmLocation);
try {
Response<FilmLocation> response = locationCall.execute();
if (response.isSuccessful()) {
... | protected Boolean doInBackground(Void... voids){
Boolean successfulQuery = false;
Call<FilmLocation> locationCall = filmTourApplication.getService().postFilmLocation(token, newFilmLocation);
try {
Response<FilmLocation> response = locationCall.execute();
if (response.isSuccessful()) {
... | |
841 | private List<MenuItemDTO> getMenuItemsOf(int menuIndex, int docId, MenuItemsStatus status, String langCode, boolean isVisible){
final Function<Integer, Version> versionReceiver = MenuItemsStatus.ALL.equals(status) ? versionService::getDocumentWorkingVersion : versionService::getLatestVersion;
final Version ve... | private List<MenuItemDTO> getMenuItemsOf(int menuIndex, int docId, MenuItemsStatus status, String langCode, boolean isVisible){
final Function<Integer, Version> versionReceiver = MenuItemsStatus.ALL.equals(status) ? versionService::getDocumentWorkingVersion : versionService::getLatestVersion;
final Version ve... | |
842 | void propagateExceptions(){
WireGrid wireGrid = new ArrayWireGrid();
List<Generator> generators = new ArrayList<>();
generators.add(new Generator(new Vector2D(-1, 0), Orientation.HORIZONTALLY));
assertThrows(IllegalArgumentException.class, () -> {
wireGrid.propagateGenerators(generators);
... | void propagateExceptions(){
WireGrid wireGrid = new ArrayWireGrid();
List<Generator> generators = new ArrayList<>();
generators.add(new Generator(new Vector2D(0, 0), Orientation.HORIZONTALLY));
assertDoesNotThrow(() -> {
wireGrid.propagateGenerators(generators);
});
generators.cl... | |
843 | public ResponseEntity<StudentQuestionAnswer> updateStudentQuestionAnswer(@PathVariable Long courseId, @RequestBody StudentQuestionAnswer studentQuestionAnswer){
User user = userRetrievalService.getUserWithGroupsAndAuthorities();
log.debug("REST request to update StudentQuestionAnswer : {}", studentQuestionAns... | public ResponseEntity<StudentQuestionAnswer> updateStudentQuestionAnswer(@PathVariable Long courseId, @RequestBody StudentQuestionAnswer studentQuestionAnswer){
User user = userRetrievalService.getUserWithGroupsAndAuthorities();
log.debug("REST request to update StudentQuestionAnswer : {}", studentQuestionAns... | |
844 | public int loadIndianStateCode(String indiaStateCsvFilePath) throws CensusAnalyserException{
try (Reader reader = Files.newBufferedReader(Paths.get(indiaStateCsvFilePath))) {
Iterator<IndianStateCodeCSV> censusCSVIterator = getCSVFileIterator(reader, IndianStateCodeCSV.class);
Iterable<IndianStat... | public int loadIndianStateCode(String indiaStateCsvFilePath) throws CensusAnalyserException{
try (Reader reader = Files.newBufferedReader(Paths.get(indiaStateCsvFilePath))) {
Iterator<IndianStateCodeCSV> censusCSVIterator = getCSVFileIterator(reader, IndianStateCodeCSV.class);
return this.getCoun... | |
845 | public void tick(){
handler.getMap().tick();
player.tick();
monsters.forEach(monster -> {
if (!monster.isDeleted()) {
monster.tick();
}
});
bombs.forEach(bomb -> {
if (!bomb.isDeleted()) {
bomb.tick();
}
});
explosions.forE... | public void tick(){
handler.getMap().tick();
for (String entity : entities) {
EntityCache.get(entity).forEach(e -> {
if (!e.isDeleted()) {
e.tick();
}
});
}
handler.getCamera().focusOn((Player) EntityCache.get("player").get(0));
for (... | |
846 | public byte[] compress(byte[] data){
ByteArrayOutputStream out = new ByteArrayOutputStream(data.length);
try {
deflater.setInput(data);
deflater.finish();
byte[] zipped = new byte[BUFFER_SIZE];
while (!deflater.finished()) {
int cnt = deflater.deflate(zipped);
... | public byte[] compress(byte[] data){
ByteArrayOutputStream out = new ByteArrayOutputStream(data.length);
deflater.setInput(data);
deflater.finish();
byte[] buf = new byte[BUFFER_SIZE];
for (int len = deflater.deflate(buf); len > 0; len = deflater.deflate(buf)) {
out.write(buf, 0, len);... | |
847 | public static boolean update(AUnit medic){
if (handleHealWoundedUnit(medic)) {
return true;
}
if (handleTooFarFromRealInfantry(medic)) {
return true;
}
return false;
} | public static boolean update(AUnit medic){
if (handleHealWoundedUnit(medic)) {
return true;
}
return handleTooFarFromRealInfantry(medic);
} | |
848 | public Serializable decodeNextByte(byte nextByte){
if (objectBytes == null) {
lengthBuffer.put(nextByte);
if (!lengthBuffer.hasRemaining()) {
lengthBuffer.flip();
objectBytes = new byte[lengthBuffer.getInt()];
objectBytesIndex = 0;
lengthBuffer.... | public Serializable decodeNextByte(byte nextByte){
if (objectBytes == null) {
lengthBuffer.put(nextByte);
if (!lengthBuffer.hasRemaining()) {
lengthBuffer.flip();
objectBytes = new bguMessageFactory().getMessage(lengthBuffer.getShort());
objectBytesIndex = 0... | |
849 | public Integer[] flattenArray(Object[] inputArray){
List<Integer> flattenedIntegerList = new ArrayList<Integer>();
for (Object element : inputArray) {
if (element instanceof Integer[]) {
Integer[] elementArray = (Integer[]) element;
for (Integer currentElement : elementArray... | public Integer[] flattenArray(Object[] inputArray){
List<Integer> flattenedIntegerList = new ArrayList<Integer>();
for (Object element : inputArray) {
if (element instanceof Integer[]) {
Integer[] elementArray = (Integer[]) element;
Collections.addAll(flattenedIntegerList, e... | |
850 | public Page<Key> getPage(final String targetUrl, final TwilioRestClient client){
this.pathAccountSid = this.pathAccountSid == null ? client.getAccountSid() : this.pathAccountSid;
String resourceUrl = "https://" + Joiner.on(".").skipNulls().join(Domains.API.toString(), client.getRegion(), "twilio", "com") + "/... | public Page<Key> getPage(final String targetUrl, final TwilioRestClient client){
this.pathAccountSid = this.pathAccountSid == null ? client.getAccountSid() : this.pathAccountSid;
Request request = new Request(HttpMethod.GET, targetUrl);
return pageForRequest(client, request);
} | |
851 | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
data = getIntent();
Category category = data.getParcelableExtra("categoryModel");
theme = category.getTheme();
setTheme(Category.getStyle(theme));
noteActivityBind = DataBindingUtil.setContentView(this,... | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
data = getIntent();
Category category = data.getParcelableExtra(Keys.CATEGORY.getKey());
theme = category.getTheme();
setTheme(Category.getStyle(theme));
noteActivityBind = DataBindingUtil.setContentVie... | |
852 | private void init(AttributeSet attrs){
final Resources resources = getResources();
final TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.WheelProgressView, 0, 0);
mStrokeWidth = typedArray.getDimensionPixelSize(R.styleable.WheelProgressView_wheelThickness, DEFAULT_THICKNESS... | private void init(AttributeSet attrs){
final TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.WheelProgressView, 0, 0);
mStrokeWidth = typedArray.getDimensionPixelSize(R.styleable.WheelProgressView_wheelThickness, DEFAULT_THICKNESS);
final int progressColor = typedArray.getC... | |
853 | public void save() throws IOException{
resource.save(null);
if (dirty != null) {
dirty.setDirty(false);
commandService.getCommand(SAVE_COMMAND).isEnabled();
}
} | public void save() throws IOException{
save(dirty);
} | |
854 | protected void shutDown() throws Exception{
super.shutDown();
Exception failure = null;
try {
logAppenderInitializer.close();
} catch (Exception e) {
failure = e;
}
for (Service service : (Iterable<Service>) coreServices::descendingIterator) {
try {
... | protected void shutDown() throws Exception{
super.shutDown();
Exception failure = null;
try {
logAppenderInitializer.close();
} catch (Exception e) {
failure = e;
}
for (Service service : (Iterable<Service>) coreServices::descendingIterator) {
try {
... | |
855 | public Point findPointThruExtraPolate(Point a, Point endRange, int distance, double slope){
Point xy = new Point();
int endX = a.getX() + endRange.getX();
int endY = a.getY();
for (int startX = a.getX() + 10; startX <= endX; startX++) {
for (int startY = endY - endRange.getY(); startY <= en... | public Point findPointThruExtraPolate(Point a, Point endRange, int distance, double slope){
Point xy = new Point();
int endX = a.getX() + endRange.getX();
int endY = a.getY();
for (int startX = a.getX() + 10; startX <= endX; startX++) {
for (int startY = endY - endRange.getY(); startY <= en... | |
856 | public void onResume(){
super.onResume();
appLanguage = getAppLanguage();
if (!tempLang.equals(appLanguage)) {
allMuseumAdapter = MainActivity.museumAdapter;
allMuseumAdapter.notifyDataSetChanged();
mRecyclerView.setAdapter(allMuseumAdapter);
}
FirebaseHandler.databas... | public void onResume(){
super.onResume();
appLanguage = getAppLanguage();
if (!tempLang.equals(appLanguage)) {
getFirebaseUpdates();
}
FirebaseHandler.database.goOnline();
} | |
857 | public Integer callback(JApiClass superclass, Map<String, JApiClass> classMap, JApiChangeStatus changeStatusOfSuperclass){
for (JApiMethod jApiMethod : superclass.getMethods()) {
if (!isAbstract(jApiMethod)) {
implementedMethods.add(jApiMethod);
}
}
for (JApiMethod jApiMeth... | public Integer callback(JApiClass superclass, Map<String, JApiClass> classMap, JApiChangeStatus changeStatusOfSuperclass){
for (JApiMethod jApiMethod : superclass.getMethods()) {
if (!isAbstract(jApiMethod)) {
implementedMethods.add(jApiMethod);
}
}
for (JApiMethod jApiMeth... | |
858 | protected Module createModule(CConfiguration cConf, Configuration hConf, TwillContext context, ProgramId programId, String runId, String instanceId, @Nullable String principal){
Module module = super.createModule(cConf, hConf, context, programId, runId, instanceId, principal);
return new AbstractModule() {
... | protected Module createModule(CConfiguration cConf, Configuration hConf, ProgramOptions programOptions, ProgramRunId programRunId){
Module module = super.createModule(cConf, hConf, programOptions, programRunId);
return Modules.combine(module, new DistributedArtifactManagerModule());
} | |
859 | public void showBrowser(HeaderPanel bg){
keyBoardNeeded(false, null);
GeoGebraFrameW frameLayout = this;
ToolTipManagerW.hideAllToolTips();
final int count = frameLayout.getWidgetCount();
final int oldHeight = this.getOffsetHeight();
final int oldWidth = this.getOffsetWidth();
childVi... | public void showBrowser(MyHeaderPanel bg){
keyBoardNeeded(false, null);
GeoGebraFrameW frameLayout = this;
ToolTipManagerW.hideAllToolTips();
final int count = frameLayout.getWidgetCount();
final int oldHeight = this.getOffsetHeight();
final int oldWidth = this.getOffsetWidth();
child... | |
860 | public Result<Object> checkConnection(DbType type, String parameter){
Result<Object> result = new Result<>();
BaseDataSource datasource = DataSourceFactory.getDatasource(type, parameter);
if (datasource == null) {
putMsg(result, Status.DATASOURCE_TYPE_NOT_EXIST, type);
return result;
... | public Result<Void> checkConnection(DbType type, String parameter){
BaseDataSource datasource = DataSourceFactory.getDatasource(type, parameter);
if (datasource == null) {
return Result.errorWithArgs(Status.DATASOURCE_TYPE_NOT_EXIST, type);
}
try (Connection connection = datasource.getConne... | |
861 | public HierarchicalConfiguration<ImmutableNode> getConfiguration(String beanName) throws ConfigurationException{
FileInputStream fis = null;
try {
fis = new FileInputStream("/tmp/" + beanName + ".xml");
return FileConfigurationProvider.getConfig(fis);
} catch (IOException e) {
... | public HierarchicalConfiguration<ImmutableNode> getConfiguration(String beanName) throws ConfigurationException{
try (FileInputStream fis = new FileInputStream("/tmp/" + beanName + ".xml")) {
return FileConfigurationProvider.getConfig(fis);
} catch (IOException e) {
throw new ConfigurationEx... | |
862 | public void confirmationOfFunds(){
LOG.debug("confirmationOfFunds() Start");
viewModel.setHttpDataFlow(new StringBuilder());
xs2aModel.setProcessUUID(UUID.randomUUID());
try {
Map<String, String> requestPropertyMap = new HashMap<>();
requestPropertyMap.put("Content-Type", "applicat... | public void confirmationOfFunds(){
viewModel.setHttpDataFlow(new StringBuilder());
xs2aModel.setProcessUUID(UUID.randomUUID());
try {
Map<String, String> requestPropertyMap = new HashMap<>();
requestPropertyMap.put("Content-Type", "application/json");
requestPropertyMap.put("Ac... | |
863 | public static Object extractValueFromOWLAnnotationValue(OWLAnnotationValue aval){
if (aval.isLiteral()) {
OWLLiteral literal = aval.asLiteral().or(df.getOWLLiteral("unknownX"));
if (literal.isBoolean()) {
return literal.parseBoolean();
} else if (literal.isDouble()) {
... | public static Object extractValueFromOWLAnnotationValue(OWLAnnotationValue aval){
if (aval.isLiteral()) {
OWLLiteral literal = aval.asLiteral().or(df.getOWLLiteral("unknownX"));
if (literal.isBoolean()) {
return literal.parseBoolean();
} else if (literal.isDouble()) {
... | |
864 | boolean loopAllInnerTypes(String _type, int _i, StringList _types, StringBuilder _out, char _curChar){
if (count > 0) {
changeStack(_curChar);
_out.append(_curChar);
return false;
}
if (_curChar == StringExpUtil.LT) {
_out.append(_curChar);
count++;
... | boolean loopAllInnerTypes(String _type, int _i, StringList _types, StringBuilder _out, char _curChar){
if (changedCount(_out, _curChar)) {
return false;
}
if (_curChar == '-') {
_types.add(_out.toString());
_out.delete(0, _out.length());
return false;
}
if (... | |
865 | private void changeHudElementFocus(boolean lookForwards){
List<? extends Element> children = children();
int newIdx = 0;
int curIdx;
if (focusedHudElement != null && (curIdx = children.indexOf(focusedHudElement)) >= 0) {
newIdx = curIdx + (lookForwards ? 1 : 0);
} else {
if (l... | private void changeHudElementFocus(boolean lookForwards){
List<? extends Element> children = children();
int newIdx = 0;
int curIdx;
if (focusedHudElement != null && (curIdx = children.indexOf(focusedHudElement)) >= 0) {
newIdx = curIdx + (lookForwards ? 1 : 0);
} else {
if (!... | |
866 | static MapToList<Ability, CNAbility> buildAbilityList(List<String> types, List<String> negate, String abilityType, View view, String aspect, MapToList<Ability, CNAbility> listOfAbilities){
List<Ability> aList = new ArrayList<>(listOfAbilities.getKeySet());
Globals.sortPObjectListByName(aList);
boolean m... | static MapToList<Ability, CNAbility> buildAbilityList(List<String> types, List<String> negate, String abilityType, View view, String aspect, MapToList<Ability, CNAbility> listOfAbilities){
List<Ability> aList = new ArrayList<>(listOfAbilities.getKeySet());
Globals.sortPObjectListByName(aList);
boolean m... | |
867 | public Object setParameter(@Nonnull String name, @Nonnull String valueString) throws CommandException{
try {
String parameterName = CypherVariablesFormatter.unescapedCypherVariable(name);
Object value = evaluator.evaluate(valueString, Object.class);
queryParams.put(parameterName, new Par... | public Object setParameter(@Nonnull String name, @Nonnull String valueString) throws EvaluationException{
String parameterName = CypherVariablesFormatter.unescapedCypherVariable(name);
Object value = evaluator.evaluate(valueString, Object.class);
queryParams.put(parameterName, new ParamValue(valueString,... | |
868 | public final boolean equals(final Object o){
if (Arez.areNativeComponentsEnabled()) {
if (this == o) {
return true;
} else if (null == o || !(o instanceof Arez_LazyLoadReferenceModel)) {
return false;
} else {
final Arez_LazyLoadReferenceModel that ... | public final boolean equals(final Object o){
if (Arez.areNativeComponentsEnabled()) {
if (o instanceof Arez_LazyLoadReferenceModel) {
final Arez_LazyLoadReferenceModel that = (Arez_LazyLoadReferenceModel) o;
return this.$$arezi$$_id() == that.$$arezi$$_id();
} else {
... | |
869 | protected void buildRadioGroup(RadioGroup radioGroup){
final List<String> favouritesList = FavouritesEditor.getFavouriteLocationsNamesDialogList(getContext());
String locationName;
int size = favouritesList.size() + 1;
for (int i = 0; i < size; i++) {
int radioButtonId = i;
int rad... | protected void buildRadioGroup(RadioGroup radioGroup){
final List<String> favouritesList = FavouritesEditor.getFavouriteLocationsNamesDialogList(getContext());
String locationName;
int size = favouritesList.size() + 1;
for (int i = 0; i < size; i++) {
int radioButtonId = i;
int rad... | |
870 | public void populateViewHolder(final PostViewHolder postViewHolder, final OrderData orderData, final int position){
postViewHolder.setCustView(orderData.getCustName());
postViewHolder.setDateView(orderData.getDate());
postViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Ove... | public void populateViewHolder(final PostViewHolder postViewHolder, final OrderData orderData, final int position){
postViewHolder.setCustView(orderData.getCustName());
postViewHolder.setDateView(orderData.getDate());
postViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Ove... | |
871 | public Collection<EnrichmentMetadata> enrich(BlobTextFromDocument blobTextFromDoc){
List<EnrichmentMetadata> enriched = new ArrayList<>();
try {
for (Map.Entry<String, ManagedBlob> blob : blobTextFromDoc.getBlobs().entrySet()) {
RecognizeCelebritiesResult result = Framework.getService(Re... | public Collection<EnrichmentMetadata> enrich(BlobTextFromDocument blobTextFromDoc){
return AWSHelper.enrich(enriched -> {
for (Map.Entry<String, ManagedBlob> blob : blobTextFromDoc.getBlobs().entrySet()) {
RecognizeCelebritiesResult result = Framework.getService(RekognitionService.class).dete... | |
872 | public void process(UserDTO dto){
UserEntity entity = repository.findFirstByEmail(dto.getEmail()).orElseGet(UserEntity::new);
entity.setOuterId(dto.getId());
entity.setEmail(dto.getEmail());
entity.setFirstName(dto.getFirstName());
entity.setLastName(dto.getLastName());
entity.setDateModif... | public void process(UserDTO dto){
UserEntity entity = repository.findFirstByEmail(dto.getEmail()).orElseGet(UserEntity::new);
entity.setOuterId(dto.getId());
entity.setEmail(dto.getEmail());
entity.setFirstName(dto.getFirstName());
entity.setLastName(dto.getLastName());
entity.setDateModif... | |
873 | public void range(HttpSession session, Request request, @Param(value = "start", required = true) String start, @Param("end") String end){
executor.execute(() -> {
ByteBuffer startKey = ByteBuffer.wrap(start.getBytes(StandardCharsets.UTF_8));
if (start.isBlank()) {
sendResponse(sessio... | public void range(HttpSession session, Request request, @Param(value = "start", required = true) String start, @Param("end") String end){
executor.execute(() -> {
ByteBuffer startKey = ByteBuffer.wrap(start.getBytes(StandardCharsets.UTF_8));
if (start.isBlank()) {
sendResponse(sessio... | |
874 | public PenaltyAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType){
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_penalty, parent, false);
ViewHolder vh = new ViewHolder(view);
return vh;
} | public PenaltyAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType){
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_penalty, parent, false);
return new ViewHolder(view);
} | |
875 | private void createRandomTetromino(){
Random rand = new Random();
if (csNext == -1) {
cf = rand.nextInt(7);
int currentS = rand.nextInt(4);
cs = 0;
blocks.addAll(cb);
cb.clear();
b.newTetromino(this, cf, currentS, cb);
falling = true;
fal... | private void createRandomTetromino(){
Random rand = new Random();
if (csNext == -1) {
cf = rand.nextInt(7);
int currentS = rand.nextInt(4);
cs = 0;
blocks.addAll(cb);
cb.clear();
b.newTetromino(this, cf, currentS, cb);
falling = true;
fal... | |
876 | private File convertURItoFileIfPossible(String filePart){
File file = null;
URI fileURI;
try {
fileURI = extractFileURIFromLinePart(filePart);
file = new File(fileURI);
if (!file.exists()) {
file = null;
}
} catch (Exception e) {
}
return fi... | private File convertURItoFileIfPossible(String filePart){
File file = null;
try {
URI fileURI = extractFileURIFromLinePart(filePart);
file = new File(fileURI);
if (!file.exists()) {
file = null;
}
} catch (Exception e) {
}
return file;
} | |
877 | private T _filter(Action<T> action) throws Throwable{
if (semaphoreEnabled) {
try {
if (semaphoreTimeout > 0) {
if (semaphore.tryAcquire(semaphoreTimeout, TimeUnit.MILLISECONDS)) {
try {
return action.process();
... | private T _filter(Action<T> action) throws Throwable{
if (!semaphoreEnabled) {
return action.process();
}
try {
if (semaphoreTimeout > 0) {
if (semaphore.tryAcquire(semaphoreTimeout, TimeUnit.MILLISECONDS)) {
try {
return action.process... | |
878 | private void setupActiveOrderSelection(){
if (mSortAscending) {
switch(mSortOrder) {
case 0:
DisplayUtils.colorImageButton(mSortByNameAscendingButton);
mSortByNameAscendingText.setTextColor(getResources().getColor(R.color.color_accent));
brea... | private void setupActiveOrderSelection(){
if (mSortAscending) {
switch(mSortOrder) {
case 0:
colorActiveSortingIconAndText(mSortByNameAscendingButton, mSortByNameAscendingText);
break;
case 1:
colorActiveSortingIconAndText(mSortB... | |
879 | public void attachLifecycleHappyPathDefaultState() throws IOException{
AttachLifecycleRequest badOsd = new AttachLifecycleRequest(28L, 1L, null);
HttpResponse response = sendStandardRequest(UrlMapping.LIFECYCLE_STATE__ATTACH_LIFECYCLE, badOsd);
parseGenericResponse(response);
OsdRequest osdRequest =... | public void attachLifecycleHappyPathDefaultState() throws IOException{
AttachLifecycleRequest attachRequest = new AttachLifecycleRequest(28L, 1L, null);
HttpResponse response = sendStandardRequest(UrlMapping.LIFECYCLE_STATE__ATTACH_LIFECYCLE, attachRequest);
parseGenericResponse(response);
ObjectSys... | |
880 | private COSStream writeDataToStream(byte[] data) throws IOException{
COSStream stream = document.getDocument().createCOSStream();
COSArray filters = new COSArray();
filters.add(COSName.FLATE_DECODE);
try (OutputStream os = stream.createOutputStream(filters)) {
os.write(data);
}
re... | private COSStream writeDataToStream(byte[] data) throws IOException{
COSStream stream = document.getDocument().createCOSStream();
try (OutputStream os = stream.createOutputStream(COSName.FLATE_DECODE)) {
os.write(data);
}
return stream;
} | |
881 | private byte[] serialize(Object o, Channel localChannel) throws IOException{
try {
return _serialize(o, localChannel);
} catch (NotSerializableException e) {
IOException x = new IOException("Unable to serialize " + o);
x.initCause(e);
throw x;
}
} | private byte[] serialize(Object o, Channel localChannel) throws IOException{
try {
return _serialize(o, localChannel);
} catch (NotSerializableException e) {
IOException x = new IOException("Unable to serialize " + o, e);
throw x;
}
} | |
882 | private void $$arezi$$_dispose(){
this.$$arezi$$_preDispose();
this.$$arez$$_myValue.dispose();
} | private void $$arezi$$_dispose(){
this.$$arez$$_myValue.dispose();
} | |
883 | public void testCanReadDetails() throws Exception{
final String name = "my-job";
final String description = "My cool job.";
final Boolean buildable = new Random().nextBoolean();
final JobDetails details = new RealJobDetails(name, description, buildable);
Assert.assertEquals(name, details.displa... | public void testCanReadDetails() throws Exception{
final JobDetails details = new RealJobDetails(new XMLResource("job.xml"));
Assert.assertEquals("test-different-builds-job", details.displayName());
Assert.assertEquals("This job we use for testing builds.", details.description());
Assert.assertTrue(... | |
884 | public int loadUSCensusData(String csvFilePath) throws CensusAnalyserException{
try (Reader reader = Files.newBufferedReader(Paths.get(csvFilePath))) {
ICSVBuilder csvBuilder = CSVBuilderFactory.createCSVBuilder();
Iterator<USCensusCSV> csvFileIterator = csvBuilder.getCSVFileIterator(reader, USCe... | public int loadUSCensusData(String csvFilePath) throws CensusAnalyserException{
return this.loadCensusData(csvFilePath, USCensusCSV.class);
} | |
885 | public void add(CharID 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(CharID 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,... | |
886 | public static boolean hasSharedDigit(int firstNumber, int secondNumber){
if ((firstNumber >= 10 && firstNumber <= 99) && (secondNumber >= 10 && secondNumber <= 99)) {
int firstNumberLastDigit = 0;
int secondNumberLastDigit = 0;
int firstNumberFirstDigit = 0;
int secondNumberFirs... | public static boolean hasSharedDigit(int firstNumber, int secondNumber){
if ((firstNumber >= 10 && firstNumber <= 99) && (secondNumber >= 10 && secondNumber <= 99)) {
int firstNumberLastDigit = firstNumber % 10;
int secondNumberLastDigit = secondNumber % 10;
firstNumber /= 10;
s... | |
887 | public void optimize(Declaration declaration) throws XPathException{
ItemType contextItemType = Type.ITEM_TYPE;
if (getObjectName() == null) {
contextItemType = match.getNodeTest();
}
Expression exp = compiledTemplate.getBody();
ExpressionVisitor visitor = makeExpressionVisitor();
... | public void optimize(Declaration declaration) throws XPathException{
ItemType contextItemType = Type.ITEM_TYPE;
if (getObjectName() == null) {
contextItemType = match.getNodeTest();
}
Expression exp = compiledTemplate.getBody();
ExpressionVisitor visitor = makeExpressionVisitor();
... | |
888 | private GlobalContext getGlobalContext(){
PoolContext poolContext = (PoolContext) getServletContext().getAttribute(ESBServletContextListener.POOL_CONTEXT);
return poolContext.getGlobalContext();
} | private GlobalContext getGlobalContext(){
return (GlobalContext) getServletContext().getAttribute(ESBServletContextListener.CONTEXT);
} | |
889 | protected void actionPerformed(NodeActionEvent nodeActionEvent) throws AzureCmdException{
Project project = (Project) nodeActionEvent.getAction().getNode().getProject();
if (project == null) {
return;
}
AzureSignInAction.signInIfNotSignedIn(project).subscribe((isLoggedIn) -> {
if (... | protected void actionPerformed(NodeActionEvent nodeActionEvent) throws AzureCmdException{
Project project = (Project) nodeActionEvent.getAction().getNode().getProject();
if (project == null) {
return;
}
AzureSignInAction.requireSignedIn(project, () -> runConfiguration(project));
} | |
890 | public static void APTest1(){
try {
ConverterFactory factory = ConverterFactory.instance();
UnitConverter test = ConverterFactory.create("AtmosphereToPascal");
double result = test.convert(6.33333333333333);
assertEquals(641724.9999999997, result, 0.001);
} catch (BadConver... | public static void APTest1(){
try {
UnitConverter test = ConverterFactory.create("AtmosphereToPascal");
double result = test.convert(6.33333333333333);
assertEquals(641724.9999999997, result, 0.001);
} catch (BadConversionStringException e) {
fail();
}
} | |
891 | public void testDeleteProcessDefinitionVersion(){
String projectName = "test";
Map<String, Object> resultMap = new HashMap<>();
putMsg(resultMap, Status.SUCCESS);
Mockito.when(processDefinitionVersionService.deleteByProcessDefinitionIdAndVersion(user, projectName, 1, 10)).thenReturn(resultMap);
... | public void testDeleteProcessDefinitionVersion(){
String projectName = "test";
Mockito.when(processDefinitionVersionService.deleteByProcessDefinitionIdAndVersion(user, projectName, 1, 10)).thenReturn(Result.success(null));
Result<Void> result = processDefinitionController.deleteProcessDefinitionVersion(u... | |
892 | public void onImageAvailable(ImageReader reader){
if (computing)
return;
Image image = null;
try {
image = reader.acquireLatestImage();
if (image == null) {
return;
}
computing = true;
TFMobileImageHelper.imageToBitmap(image, bitmap);
... | public void onImageAvailable(ImageReader reader){
if (computing_)
return;
Image image = null;
try {
image = reader.acquireLatestImage();
if (image == null)
return;
computing_ = true;
TFImageHelper.imageToBitmap(image, bitmap_);
final Canv... | |
893 | public void onAction(String actionString, boolean ongoing, float tpf){
if (ongoing) {
logger.log(Level.INFO, "Got action {0}", MyString.quote(actionString));
}
boolean handled = false;
if (ongoing) {
InputMode defaultMode = actionApplication.getDefaultInputMode();
switch(a... | public void onAction(String actionString, boolean ongoing, float tpf){
if (ongoing) {
logger.log(Level.INFO, "Got action {0}", MyString.quote(actionString));
}
boolean handled = false;
if (ongoing) {
InputMode defaultMode = actionApplication.getDefaultInputMode();
switch(a... | |
894 | public void testNextGeneration(){
try (ConfigTester tester = new ConfigTester()) {
tester.startOneConfigServer();
GenericConfigHandle handle = subscriber.subscribe(new ConfigKey<>("app", "app.0", "config"), Arrays.asList(AppConfig.CONFIG_DEF_SCHEMA), tester.getTestSourceSet(), ConfigTester.getTes... | public void testNextGeneration(){
try (ConfigTester tester = new ConfigTester()) {
tester.startOneConfigServer();
GenericConfigHandle handle = subscriber.subscribe(new ConfigKey<>("app", "app.0", "config"), Arrays.asList(AppConfig.CONFIG_DEF_SCHEMA), tester.getTestSourceSet(), getTestTimingValues... | |
895 | public String add(@RequestParam("dishList") List<Dish> dishList){
System.out.println(dishList);
Meal meal1 = new Meal();
return "adminHomePage";
} | public String add(@RequestParam("day") String day, @RequestParam("type") String type, @RequestParam("dishList") List<Dish> dishList){
mealService.addMeal(day, type, dishList);
return "adminHomePage";
} | |
896 | public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random){
if (!world.isClient) {
for (int xOffset = -1; xOffset <= 1; xOffset++) {
for (int zOffset = -1; zOffset <= 1; zOffset++) {
if (!world.isChunkLoaded((pos.getX() >> 4) + xOffset, (pos.getZ... | public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random){
if (!world.isClient) {
for (int xOffset = -1; xOffset <= 1; xOffset++) {
for (int zOffset = -1; zOffset <= 1; zOffset++) {
if (!world.isChunkLoaded((pos.getX() >> 4) + xOffset, (pos.getZ... | |
897 | public static Iterable<R> wrap(final Iterable<R> inner, final int limit){
return new Iterable<R>() {
@Override
public Iterator<R> iterator() {
return new ResultSetIterator<R>(inner.iterator(), limit);
}
};
} | public static Iterable<R> wrap(final Iterable<R> inner, final int limit){
return () -> new ResultSetIterator<R>(inner.iterator(), limit);
} | |
898 | public void runOrFight(GameMap game){
Scanner choice = new Scanner(System.in);
try {
System.out.println("\n\t1. Run\t2.Fight");
int inputChoice = choice.nextInt();
if (inputChoice == 1) {
game.fleeEnermy();
return;
}
if (inputChoice == 2) ... | public void runOrFight(GameMap game){
Scanner choice = new Scanner(System.in);
try {
System.out.println("\n\t1. Run\t2.Fight");
int inputChoice = choice.nextInt();
if (inputChoice == 1) {
game.fleeEnemy();
return;
}
if (inputChoice == 2) {... | |
899 | public Integer list(@CommandLine.Parameters(paramLabel = "name", index = "0", description = "The name of a catalog", arity = "0..1") String name){
PrintWriter out = spec.commandLine().getOut();
PrintWriter err = spec.commandLine().getErr();
if (name == null) {
Settings.getCatalogs().keySet().str... | public Integer list(@CommandLine.Parameters(paramLabel = "name", index = "0", description = "The name of a catalog", arity = "0..1") String name){
PrintStream out = System.out;
if (name == null) {
Settings.getCatalogs().keySet().stream().sorted().forEach(nm -> {
AliasUtil.Catalog cat = S... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.