Unnamed: 0 int64 0 9.45k | cwe_id stringclasses 1
value | source stringlengths 37 2.53k | target stringlengths 19 2.4k |
|---|---|---|---|
300 | public Map<String, SubmoduleStatus> call() throws GitAPIException{
checkCallable();
try (SubmoduleWalk generator = SubmoduleWalk.forIndex(repo)) {
if (!paths.isEmpty())
generator.setFilter(PathFilterGroup.createFromStrings(paths));
Map<String, SubmoduleStatus> statuses = new Has... | public Map<String, SubmoduleStatus> call() throws GitAPIException{
checkCallable();
try (SubmoduleWalk generator = SubmoduleWalk.forIndex(repo)) {
if (!paths.isEmpty())
generator.setFilter(PathFilterGroup.createFromStrings(paths));
Map<String, SubmoduleStatus> statuses = new Has... | |
301 | public ExtractedFileSet extract(DownloadConfig runtime, File source, FilesToExtract toExtract) throws IOException{
Builder builder = ExtractedFileSet.builder(toExtract.baseDir()).baseDirIsGenerated(toExtract.baseDirIsGenerated());
ProgressListener progressListener = runtime.getProgressListener();
String ... | public ExtractedFileSet extract(DownloadConfig runtime, File source, FilesToExtract toExtract) throws IOException{
Builder builder = ExtractedFileSet.builder(toExtract.baseDir()).baseDirIsGenerated(toExtract.baseDirIsGenerated());
ProgressListener progressListener = runtime.getProgressListener();
String ... | |
302 | public String trackAllStuffByStuffTypes(Model model, @PathVariable("stuffType.id") Long stuffTypeId, HttpSession session){
List<Buttons> buttons = buttonsService.getAllWhereParentIdIsNull(new Sort(Sort.Direction.ASC, "id"));
model.addAttribute("buttons", buttons);
List<Buttons> button = buttonsService.ge... | public String trackAllStuffByStuffTypes(Model model, @PathVariable("stuffType.id") Long stuffTypeId, HttpSession session){
List<Buttons> buttons = buttonsService.getAllWhereParentIdIsNull(new Sort(Sort.Direction.ASC, "id"));
model.addAttribute("buttons", buttons);
List<Buttons> button = buttonsService.ge... | |
303 | public void getBugHTML() throws ServletException, IOException{
final String bugURI = getRequestURI();
final Model model = getBugModel(getRequestURI());
setBugResponseHeaders();
final String etag = ETag.generate(model);
testIfNoneMatch(etag);
setETagHeader(etag);
setBugAttributes(model... | public void getBugHTML() throws ServletException, IOException{
final String bugURI = getRequestURI();
final Model model = getBugModel(getRequestURI());
setBugResponseHeaders();
handleETags(model);
setBugAttributes(model, bugURI);
request.getRequestDispatcher("/WEB-INF/bug.jsp").forward(req... | |
304 | public ArrayList<Person> readFile(){
ArrayList<Person> records = new ArrayList<Person>();
Scanner in;
try {
in = new Scanner(new FileInputStream(this.fileName), "UTF-8");
in.nextLine();
while (in.hasNext()) {
String line = in.nextLine();
String[] field... | public ArrayList<Person> readFile(){
ArrayList<Person> records = new ArrayList<Person>();
Scanner in;
try {
in = new Scanner(new FileInputStream(this.fileName), "UTF-8");
in.nextLine();
while (in.hasNext()) {
Person personRecord = mapLineToRecord(in.nextLine());
... | |
305 | public FormattedParameters checkParams(ExecRootBlock _rootBlock, String _classNameFound, Argument _previous, Cache _cache, ContextEl _conf, MethodAccessKind _kind, StackCall _stackCall){
LgNames stds_ = _conf.getStandards();
String cast_ = stds_.getContent().getCoreNames().getAliasCastType();
String clas... | public Argument checkParams(String _classNameFound, Argument _previous, Cache _cache, ContextEl _conf, MethodAccessKind _kind, StackCall _stackCall){
LgNames stds_ = _conf.getStandards();
String cast_ = stds_.getContent().getCoreNames().getAliasCastType();
String classFormat_ = _classNameFound;
Form... | |
306 | private void parseTerm(){
Intent intent = getIntent();
currentTermUri = intent.getParcelableExtra(DataProvider.TERM_CONTENT_TYPE);
termId = Integer.parseInt(currentTermUri.getLastPathSegment());
currentTerm = DataManager.getTerm(this, termId);
} | private void parseTerm(){
Intent intent = getIntent();
termId = intent.getIntExtra(DBOpenHelper.TERM_ID, 0);
currentTerm = DataManager.getTerm(this, termId);
} | |
307 | private void patchRequestSalesOffer(){
RequestQueue queue = Volley.newRequestQueue(getApplicationContext());
String url = getRequestUrl() + "salesoffers/" + getIntent().getExtras().getLong("id");
JSONObject postData = makeSalesOfferDataJson();
Log.v(TAG, String.valueOf(postData));
JsonObjectReq... | private void patchRequestSalesOffer(){
String url = getRequestUrl() + "salesoffers/" + getIntent().getExtras().getLong("id");
JSONObject postData = makeSalesOfferDataJson();
Log.v(TAG, String.valueOf(postData));
Log.v(TAG, "Invoking categoryRequestProcessor");
requestProcessor.makeRequest(Reque... | |
308 | public void applyApplications(@Nonnull Map<String, ApplicationBean> desiredApplications){
checkNotNull(desiredApplications);
ApplicationsOperations applicationsOperations = new ApplicationsOperations(cfOperations);
log.info("Fetching information about applications...");
Map<String, ApplicationBean> ... | public void applyApplications(@Nonnull Map<String, ApplicationBean> desiredApplications){
checkNotNull(desiredApplications);
ApplicationsOperations applicationsOperations = new ApplicationsOperations(cfOperations);
log.info("Fetching information about applications...");
Map<String, ApplicationBean> ... | |
309 | private void processData(ByteBuffer data) throws IOException, InterruptedException{
int firstPacketElement = data.getInt();
int seqNum = firstPacketElement & ~LAST_MESSAGE_FLAG_BIT_MASK;
boolean isEndOfStream = ((firstPacketElement & LAST_MESSAGE_FLAG_BIT_MASK) != 0);
if (seqNum > maxSeqNum || seqNu... | private void processData(ByteBuffer data) throws IOException, InterruptedException{
int firstPacketElement = data.getInt();
int seqNum = firstPacketElement & ~LAST_MESSAGE_FLAG_BIT_MASK;
boolean isEndOfStream = ((firstPacketElement & LAST_MESSAGE_FLAG_BIT_MASK) != 0);
if (seqNum > maxSeqNum || seqNu... | |
310 | public String GetEmployeeInformation(){
String value = this.GetId() + " " + this.GetName();
return value;
} | public String GetEmployeeInformation(){
return this.GetId() + " " + this.GetName();
} | |
311 | public PaymentRequest createPaymentRequest(IPaymentRequestSpecification spec){
if (!(spec.getWallet() instanceof IGeneratesNewDepositCryptoAddress)) {
throw new IllegalArgumentException("Wallet '" + spec.getWallet().getClass() + "' does not implement " + IGeneratesNewDepositCryptoAddress.class.getSimpleNa... | public PaymentRequest createPaymentRequest(IPaymentRequestSpecification spec){
if (spec.getTotal().stripTrailingZeros().scale() > decimals) {
throw new IllegalArgumentException(cryptoCurrency + " has " + decimals + " decimals");
}
return super.createPaymentRequest(spec);
} | |
312 | void syncMojitoWithThirdPartyTMS(Long repositoryId, String thirdPartyProjectId, List<ThirdPartySyncAction> actions, String pluralSeparator, String localeMapping, String skipTextUnitsWithPattern, String skipAssetsWithPathPattern, List<String> options){
pluralSeparator = replaceSpacePlaceholder(pluralSeparator);
... | void syncMojitoWithThirdPartyTMS(Long repositoryId, String thirdPartyProjectId, List<ThirdPartySyncAction> actions, String pluralSeparator, String localeMapping, String skipTextUnitsWithPattern, String skipAssetsWithPathPattern, List<String> options){
logger.debug("Thirdparty TMS Sync: repositoryId={} thirdPartyP... | |
313 | public List<ItemStack> getCraftedItems(){
if (alreadyProcessing || !isEnabled())
return Collections.emptyList();
if (stillNeedReplace()) {
return new ArrayList<>();
}
try {
alreadyProcessing = true;
IRouter myRouter = getRouter();
List<ExitRoute> exits = ... | public List<ItemStack> getCraftedItems(){
if (alreadyProcessing || !isEnabled())
return Collections.emptyList();
if (stillNeedReplace())
return new ArrayList<>();
try {
alreadyProcessing = true;
IRouter myRouter = getRouter();
List<ExitRoute> exits = new Array... | |
314 | public void failsIfBodyAssertionFails() throws IOException{
exceptionRule.expect(RequestAssertionException.class);
exceptionRule.expectMessage(allOf(containsString("Expected: a string containing \"\\\"property\\\": \\\"value\\\"\""), containsString("but: was \"{\"another\": \"someother\"}\"")));
server.e... | public void failsIfBodyAssertionFails() throws IOException{
exceptionRule.expect(RequestAssertionException.class);
exceptionRule.expectMessage(containsString("bodyMatcher = a string containing \"\\\"property\\\": \\\"value\\\"\""));
server.addFixture(200, "body.json").ifRequestMatches().bodyMatches(conta... | |
315 | public double calculateF(Cell start, Cell end){
int deltaX = this.x - end.getX();
if (deltaX < 0)
deltaX *= -1;
int deltaY = this.y - end.getY();
if (deltaY < 0)
deltaY *= -1;
return Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)) + getG(start, end);
} | public double calculateF(Cell start, Cell end){
int deltaX = Math.abs(this.x - end.getX());
int deltaY = Math.abs(this.y - end.getY());
double h = Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));
return getG(start, end) + h;
} | |
316 | 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... | |
317 | public void onCreate(@Nullable Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_trailer);
final Bundle extras = getIntent().getExtras();
if (extras != null && extras.containsKey(EXTRA_VIDEO_ID)) {
videoId = extras.getString(EXTRA_VIDEO_ID);
... | public void onCreate(@Nullable Bundle savedInstanceState){
super.onCreate(savedInstanceState);
final Bundle extras = getIntent().getExtras();
if (extras != null && extras.containsKey(EXTRA_VIDEO_ID)) {
videoId = extras.getString(EXTRA_VIDEO_ID);
} else {
finish();
}
setCo... | |
318 | public void choose(){
if (listInfo.getNumNames() == 0) {
return;
}
if (settings.isPresentationModeEnabled()) {
if (!canShowPresentationScreen) {
return;
}
canShowPresentationScreen = false;
Intent intent = new Intent(this, PresentationActivity.cla... | public void choose(){
if (listInfo.getNumNames() == 0) {
return;
}
if (settings.isPresentationModeEnabled()) {
if (!canShowPresentationScreen) {
return;
}
canShowPresentationScreen = false;
Intent intent = new Intent(this, PresentationActivity.cla... | |
319 | private static void goHome(){
int distance = Integer.MAX_VALUE;
SensorMode seek = Fetchy.seekerSensor.getSeekMode();
float[] sample = new float[seek.sampleSize()];
seek.fetchSample(sample, 0);
int direction = (int) sample[0];
System.out.println("Direction: " + direction);
distance = (... | private static void goHome(){
SensorMode seek = Fetchy.seekerSensor.getSeekMode();
float[] sample = new float[seek.sampleSize()];
seek.fetchSample(sample, 0);
int direction = (int) sample[0];
System.out.println("Direction: " + direction);
int distance = (int) sample[1];
System.out.pri... | |
320 | public void userActivate(Feature feature, String user){
{
FeatureMetadata metadata = repository().getFeature(feature, null);
if (metadata == null) {
metadata = new DefaultFeatureMetadata(feature);
}
metadata.set(FeatureKeys.STATUS, String.valueOf(Status.RESTRICTED.g... | public void userActivate(Feature feature, String user){
{
final FeatureMetadata metadata = getMetadata(feature, user).set(FeatureKeys.STATUS, String.valueOf(Status.RESTRICTED.getCode()));
repository().updateFeature(metadata, null);
}
{
FeatureMetadata metadata = repository().ge... | |
321 | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_category);
binding = ActivityCategoryBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Stri... | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_category);
binding = ActivityCategoryBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Stri... | |
322 | void transferVideo(File[] videoCollection, Socket clientSocket) throws IOException{
OutputStream clientSocketOS = clientSocket.getOutputStream();
BufferedOutputStream clientSocketBOS = new BufferedOutputStream(clientSocketOS);
DataOutputStream clientSocketDOS = new DataOutputStream(clientSocketBOS);
... | void transferVideo(File[] videoCollection, Socket clientSocket) throws IOException{
OutputStream clientSocketOS = clientSocket.getOutputStream();
BufferedOutputStream clientSocketBOS = new BufferedOutputStream(clientSocketOS);
DataOutputStream clientSocketDOS = new DataOutputStream(clientSocketBOS);
... | |
323 | public void process7Test(){
String locale_ = "en";
String folder_ = "messages";
String relative_ = "sample/file";
String content_ = "one=Description one\ntwo=Description two\nthree=desc <{0}>";
String html_ = "<html><body><ul><c:for var=\"s\" list=\"$new java.lang.Integer[]{}\" className=... | public void process7Test(){
String locale_ = "en";
String folder_ = "messages";
String relative_ = "sample/file";
String content_ = "one=Description one\ntwo=Description two\nthree=desc <{0}>";
String html_ = "<html><body><ul><c:for var=\"s\" list=\"$new java.lang.Integer[]{}\" className=... | |
324 | public void shouldReturn200IfLoginSucceed() throws Exception{
final PiggyBankUser piggyBankUser = new PiggyBankUser();
piggyBankUser.setUsername("username");
piggyBankUser.setPassword("password");
piggyBankUser.setToken("token");
final String requestBody = "{\n" + " \"username\": \"username\... | public void shouldReturn200IfLoginSucceed() throws Exception{
final PiggyBankUser piggyBankUser = forUsernamePasswordAndToken(USERNAME, PASSWORD, "token");
final String requestBody = "{\n" + " \"username\": \"username\",\n" + " \"password\": \"password\"\n" + "}";
when(authenticationService.authent... | |
325 | public DistributionQueue getQueue(@NotNull String queueName) throws DistributionException{
String key = getKey(queueName);
return queueMap.computeIfAbsent(key, k -> {
statusMap.put(key, new ConcurrentHashMap<>());
if (isActive) {
return new ActiveResourceQueue(resolverFactory, s... | public DistributionQueue getQueue(@NotNull String queueName) throws DistributionException{
return queueMap.computeIfAbsent(queueName, name -> {
if (isActive) {
return new ActiveResourceQueue(resolverFactory, serviceName, name, agentRootPath);
} else {
return new Resource... | |
326 | public ResponseDTO deleteTask(@RequestBody TodoTaskDto taskDTO){
if (taskDTO.getId() == 0) {
logger.error("Task Id is invalid.");
return TodoTaskUtil.createResponseFalied("Task Id is invalid.");
}
try {
ResponseDTO responseDTO = todoTaskService.delete(taskDTO);
retur... | public ResponseDTO deleteTask(@RequestBody TodoTaskDto taskDTO){
if (taskDTO.getId() == 0) {
logger.error("Task Id is invalid.");
return TodoTaskUtil.createResponseFalied("Task Id is invalid.");
}
try {
return todoTaskService.delete(taskDTO);
} catch (Exception e) {
... | |
327 | public void initialize(URL url, ResourceBundle resourceBundle){
connectionsComboBox.itemsProperty().bind(Context.getInstance().getConnections());
queryArea = new CodeArea();
queryArea.setParagraphStyle(0, Collections.singletonList("has-caret"));
queryArea.setOnKeyPressed(new EventHandler<KeyEvent>()... | public void initialize(URL url, ResourceBundle resourceBundle){
connectionsComboBox.itemsProperty().bind(Context.getInstance().getConnections());
queryArea = new CodeArea();
queryArea.setParagraphStyle(0, Collections.singletonList("has-caret"));
queryArea.setOnKeyPressed(event -> {
if (even... | |
328 | public Result unauthorizedUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("alertgroupId") Integer alertgroupId){
logger.info("unauthorized user, login user:{}, alert group id:{}", loginUser.getUserName(), alertgroupId);
Map<String, Object> result = usersService.... | public Result<List<User>> unauthorizedUser(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("alertgroupId") Integer alertgroupId){
logger.info("unauthorized user, login user:{}, alert group id:{}", loginUser.getUserName(), alertgroupId);
return usersService.unauthoriz... | |
329 | public UserPojo getMe() throws DataNotFoundException, ExecutionFailException, ExistRecordException{
try {
return userService.getMe();
} catch (ServiceException ex) {
exceptionConverter.convert(ex);
}
throw new DataNotFoundException("No such user data is found");
} | public UserPojo getMe() throws DataNotFoundException{
return userService.getMe();
} | |
330 | public boolean hasSameMethod(Invocation candidate){
Method m1 = invocation.getMethod();
Method m2 = candidate.getMethod();
if (m1.getName() != null && m1.getName().equals(m2.getName())) {
Class<?>[] params1 = m1.getParameterTypes();
Class<?>[] params2 = m2.getParameterTypes();
... | public boolean hasSameMethod(Invocation candidate){
Method m1 = invocation.getMethod();
Method m2 = candidate.getMethod();
if (m1.getName() != null && m1.getName().equals(m2.getName())) {
Class<?>[] params1 = m1.getParameterTypes();
Class<?>[] params2 = m2.getParameterTypes();
... | |
331 | public UserProfile getCurrentUserProfile(){
UserProfile user = new UserProfile("XXX", "jmcmahon", "apiKey", DateTime.now());
return userProfileDao.save(user);
} | public UserProfile getCurrentUserProfile(){
return null;
} | |
332 | public static void close(){
try {
CLIENT_HANDLER_SERVICE.awaitTermination(2000, TimeUnit.MILLISECONDS);
VERIFICATION_HANDLER_SERVICE.awaitTermination(2000, TimeUnit.MILLISECONDS);
DATABASE_SERVICE.awaitTermination(2000, TimeUnit.MILLISECONDS);
SERVER_EXECUTOR.awaitTermination(20... | public static void close(){
try {
CLIENT_HANDLER_SERVICE.awaitTermination(2000, TimeUnit.MILLISECONDS);
DATABASE_SERVICE.awaitTermination(2000, TimeUnit.MILLISECONDS);
SERVER_EXECUTOR.awaitTermination(2000, TimeUnit.MILLISECONDS);
} catch (InterruptedException ignore) {
}
} | |
333 | public Object clone() throws CloneNotSupportedException{
StatementTree v = (StatementTree) super.clone();
HashMap cloned_map = new HashMap();
v.map = cloned_map;
Iterator i = map.keySet().iterator();
while (i.hasNext()) {
Object key = i.next();
Object entry = map.get(key);
... | public Object clone() throws CloneNotSupportedException{
StatementTree v = (StatementTree) super.clone();
HashMap cloned_map = new HashMap();
v.map = cloned_map;
for (Object key : map.keySet()) {
Object entry = map.get(key);
entry = cloneSingleObject(entry);
cloned_map.put... | |
334 | public int onStartCommand(Intent intent, int flags, int id){
int audioType = intent != null ? intent.getIntExtra(EXTRA_AUDIO_TYPE, Utils.PREF_AUDIO_RECORDING_TYPE_DEFAULT) : Utils.PREF_AUDIO_RECORDING_TYPE_DEFAULT;
mLayer = new OverlayLayer(this);
mLayer.setOnActionClickListener(() -> {
Intent f... | public int onStartCommand(Intent intent, int flags, int id){
mLayer = new OverlayLayer(this);
mLayer.setOnActionClickListener(() -> {
Intent fabIntent = new Intent(ScreencastService.ACTION_START_SCREENCAST);
startService(fabIntent.setClass(this, ScreencastService.class));
Utils.setS... | |
335 | private void updateUpButtonPosition(){
int upButtonNormalBottom = mTopInset + mUpButton.getHeight();
mUpButton.setTranslationY(Math.min(mSelectedItemUpButtonFloor - upButtonNormalBottom, 0));
} | private void updateUpButtonPosition(){
} | |
336 | public static void forkSystemServerPre(int uid, int gid, int[] gids, int debugFlags, int[][] rlimits, long permittedCapabilities, long effectiveCapabilities){
Router.onForkStart();
Router.initResourcesHook();
final boolean isDynamicModulesMode = Main.isDynamicModulesEnabled();
ConfigManager.setDynam... | public static void forkSystemServerPre(int uid, int gid, int[] gids, int debugFlags, int[][] rlimits, long permittedCapabilities, long effectiveCapabilities){
Router.onForkStart();
Router.initResourcesHook();
Router.prepare(true);
PrebuiltMethodsDeopter.deoptBootMethods();
Router.installBootstr... | |
337 | public Vector2f add(Vector2fc v){
x += v.x();
y += v.y();
return this;
} | public Vector2f add(Vector2fc v){
return add(v, this);
} | |
338 | public void bind(VideoItem videoItem){
videoImage.post(() -> Glide.with(context).load(videoItem.getThumb()).diskCacheStrategy(DiskCacheStrategy.AUTOMATIC).listener(new RequestListener<Drawable>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> ... | public void bind(VideoItem videoItem){
loadImageFromVideoItem(videoItem, videoImage, context);
videoTitle.setText(videoItem.getTitle());
videoSubtitle.setText(videoItem.getSubtitle());
} | |
339 | private Document getDocument(String xml){
try {
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
return parser.parse(new InputSource(new StringReader(xml)));
} catch (ParserConfigurationException | SAXException | IOException e) {
e.printStackTrace(... | private Document getDocument(String xml){
try {
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
return parser.parse(new InputSource(new StringReader(xml)));
} catch (ParserConfigurationException | SAXException | IOException e) {
throw new RuntimeE... | |
340 | public static OwnerNodeProperty getOwnerProperty(@Nonnull Node node){
NodeProperty prop = node.getNodeProperties().get(OwnerNodeProperty.class);
return prop != null ? (OwnerNodeProperty) prop : null;
} | public static OwnerNodeProperty getOwnerProperty(@Nonnull Node node){
return node.getNodeProperties().get(OwnerNodeProperty.class);
} | |
341 | public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request){
String currentHost = "http://" + Uri.parse(view.getUrl()).getHost();
if (!currentHost.equals(prodUrl) && !currentHost.equals(devUrl)) {
return true;
}
String query = request.getUrl().getQuery();
if (quer... | public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request){
if (!Utilities.urlIsTrusted(view.getUrl())) {
return true;
}
String query = request.getUrl().getQuery();
if (query != null) {
String queryCommand = query.substring(0, query.indexOf('&'));
ca... | |
342 | public void removeDuplicates(){
int i_ = FIRST_INDEX;
while (true) {
if (i_ >= size()) {
break;
}
T e_ = get(i_);
boolean rem_ = false;
int next_ = indexOfObj(e_, i_ + 1);
while (next_ != INDEX_NOT_FOUND_ELT) {
removeAt(next_);
... | public void removeDuplicates(){
int i_ = FIRST_INDEX;
while (i_ < size()) {
T e_ = get(i_);
boolean rem_ = false;
int next_ = indexOfObj(e_, i_ + 1);
while (next_ != INDEX_NOT_FOUND_ELT) {
removeAt(next_);
rem_ = true;
next_ = indexOfO... | |
343 | public void call(java.lang.Integer numTimes, Float32Member a, Float32Member b){
assign().call(a, b);
for (int i = 0; i < numTimes; i++) divide().call(b, TWO, b);
} | public void call(java.lang.Integer numTimes, Float32Member a, Float32Member b){
ScaleHelper.compute(G.FLT, G.FLT, new Float32Member(0.5f), numTimes, a, b);
} | |
344 | public Profile enableProfile(String profileId, String... attributesToReturn) throws ProfileException{
Profile profile = updateProfile(profileId, new UpdateCallback() {
@Override
public void doWithProfile(ProfileUpdater profileUpdater) throws ProfileException {
profileUpdater.setEna... | public Profile enableProfile(String profileId, String... attributesToReturn) throws ProfileException{
Profile profile = updateProfile(profileId, profileUpdater -> profileUpdater.setEnabled(true), attributesToReturn);
logger.debug(LOG_KEY_PROFILE_ENABLED, profileId);
return profile;
} | |
345 | private void displayPlace(Place place){
if (place == null)
return;
String content = "";
if (!TextUtils.isEmpty(place.getAddress())) {
content += place.getAddress();
}
if (!TextUtils.isEmpty(String.valueOf(place.getLatLng()))) {
Log.e("MainActivity", "Latlong: " + Stri... | private void displayPlace(Place place){
if (place == null)
return;
String content = "";
if (!TextUtils.isEmpty(place.getAddress())) {
content += place.getAddress();
}
if (!TextUtils.isEmpty(String.valueOf(place.getLatLng()))) {
LatLng mLatLng = place.getLatLng();
... | |
346 | public Set<InternalNode> getNodes(NodeState state){
switch(state) {
case ACTIVE:
return getAllNodes().getActiveNodes();
case INACTIVE:
return getAllNodes().getInactiveNodes();
case SHUTTING_DOWN:
return getAllNodes().getShuttingDownNodes();
... | public Set<InternalNode> getNodes(NodeState state){
switch(state) {
case ACTIVE:
return getAllNodes().getActiveNodes();
case INACTIVE:
return getAllNodes().getInactiveNodes();
case SHUTTING_DOWN:
return getAllNodes().getShuttingDownNodes();
}
... | |
347 | public void run(){
if (sendError) {
callback.onError(ActiveMQExceptionType.UNSUPPORTED_PACKET.getCode(), "Fake aio error");
} else {
try {
file.data.put(bytes);
if (callback != null) {
callback.done();
}
if (file.bufferCall... | public void run(){
if (sendError) {
callback.onError(ActiveMQExceptionType.UNSUPPORTED_PACKET.getCode(), "Fake aio error");
} else {
try {
file.data.put(bytes);
if (callback != null) {
callback.done();
}
} catch (Throwable e) {... | |
348 | void loadBlock(int count){
new Thread(() -> {
JSONObject requestParams;
rpcRequest request;
rpcResponse response;
Block block;
String prevBlockHash;
int i = 0;
try {
if (mBlockListAdpater.dataList.size() == 0) {
request =... | void loadBlock(int count, Block lastBlock){
new Thread(() -> {
ArrayList<Block> blocks = new ArrayList<>();
JSONObject requestParams;
rpcRequest request;
rpcResponse response;
Block block;
String prevBlockHash;
int i = 0;
try {
i... | |
349 | public static int getForegroundWhiteOrBlack(int backgroundColor){
int alpha = Color.alpha(backgroundColor);
Log.d("TempTag", "alpha : " + alpha);
int blue = Color.blue(backgroundColor);
int green = Color.green(backgroundColor);
int red = Color.red(backgroundColor);
double luminanceGris = (... | public static int getForegroundWhiteOrBlack(int backgroundColor){
int blue = Color.blue(backgroundColor);
int green = Color.green(backgroundColor);
int red = Color.red(backgroundColor);
double luminanceGris = (0.2126 * red) + (0.7152 * green) + (0.0722 * blue);
if (luminanceGris < 128) {
... | |
350 | private void selectCity(){
isBuildingUi = true;
if (cityInformationPanel != null) {
}
cityData.removeAll();
currentlySelectedCity = cityList.getSelectedValue();
if (currentlySelectedCity != null) {
cityInformationPanel = new CityInformationPanel(gameState, this, currentlySelectedC... | private void selectCity(){
isBuildingUi = true;
cityData.removeAll();
currentlySelectedCity = cityList.getSelectedValue();
if (currentlySelectedCity != null) {
cityInformationPanel = new CityInformationPanel(gameState, this, currentlySelectedCity, planet, owner, provider);
cityData... | |
351 | public void onViewCreated(View view, Bundle savedInstanceState){
super.onViewCreated(view, savedInstanceState);
boolean dozeEnabled = Utils.isDozeEnabled(getActivity());
mTextView = (TextView) view.findViewById(R.id.switch_text);
mTextView.setText(getString(dozeEnabled ? R.string.switch_bar_on : R.s... | public void onViewCreated(View view, Bundle savedInstanceState){
super.onViewCreated(view, savedInstanceState);
boolean dozeEnabled = Utils.isDozeEnabled(getActivity());
mTextView = view.findViewById(R.id.switch_text);
mTextView.setText(getString(dozeEnabled ? R.string.switch_bar_on : R.string.switc... | |
352 | public SCCCiphertext encryptAsymmetric(AbstractSCCKey key, PlaintextContainerInterface plaintext) throws SCCException{
if (key.getKeyType() == KeyType.Asymmetric) {
if (usedAlgorithm == null) {
ArrayList<SCCAlgorithm> algorithms = currentSCCInstance.getUsage().getAsymmetricEncryption();
... | public SCCCiphertext encryptAsymmetric(AbstractSCCKey key, PlaintextContainerInterface plaintext) throws SCCException{
if (key.getKeyType() == KeyType.Asymmetric) {
if (usedAlgorithm == null) {
ArrayList<SCCAlgorithm> algorithms = currentSCCInstance.getUsage().getAsymmetricEncryption();
... | |
353 | public Integer getDeduplicationSnapshotInterval(String topic) throws PulsarAdminException{
try {
return getDeduplicationSnapshotIntervalAsync(topic).get(this.readTimeoutMs, TimeUnit.MILLISECONDS);
} catch (ExecutionException e) {
throw (PulsarAdminException) e.getCause();
} catch (Inter... | public Integer getDeduplicationSnapshotInterval(String topic) throws PulsarAdminException{
return sync(() -> getDeduplicationSnapshotIntervalAsync(topic));
} | |
354 | public void visit(MethodCallExpr callExpr, Object arg){
String name = callExpr.getName();
Expression expr = callExpr.getScope();
String scope = expr == null ? null : expr.toString();
List<Expression> args = callExpr.getArgs();
ContractElement p = initConstraint();
p.setProgramVersion(Progr... | public void visit(MethodCallExpr callExpr, Object arg){
String name = callExpr.getName();
Expression expr = callExpr.getScope();
String scope = expr == null ? null : expr.toString();
List<Expression> args = callExpr.getArgs();
ContractElement p = initConstraint();
p.setLineNo(callExpr.getB... | |
355 | protected void run(String[] args) throws Exception{
LOG.info("Running 'run' command.");
final Options commandOptions = CliFrontendParser.getRunCommandOptions();
final CommandLine commandLine = getCommandLine(commandOptions, args, true);
final ProgramOptions programOptions = new ProgramOptions(comman... | protected void run(String[] args) throws Exception{
LOG.info("Running 'run' command.");
final Options commandOptions = CliFrontendParser.getRunCommandOptions();
final CommandLine commandLine = getCommandLine(commandOptions, args, true);
final ProgramOptions programOptions = ProgramOptions.create(com... | |
356 | private int[] getKavaImpressionInfo(PKMediaConfig pkMediaConfig){
int[] impressionResponse = new int[] { -1, 0 };
if (pkMediaConfig.getMediaEntry() != null && pkMediaConfig.getMediaEntry().getMetadata() != null && pkMediaConfig.getMediaEntry().getMetadata().containsKey(kavaPartnerIdKey)) {
String par... | private Pair<Integer, String> getKavaImpressionInfo(PKMediaConfig pkMediaConfig){
final String kavaPartnerIdKey = "kavaPartnerId";
final String kavaEntryIdKey = "entryId";
int kavaPartnerId = 0;
String kavaEntryId = null;
if (pkMediaConfig.getMediaEntry() != null && pkMediaConfig.getMediaEntry(... | |
357 | public Map<String, Object> queryDataSourceList(User loginUser, Integer type){
Map<String, Object> result = new HashMap<>();
List<DataSource> datasourceList;
if (isAdmin(loginUser)) {
datasourceList = dataSourceMapper.listAllDataSourceByType(type);
} else {
datasourceList = dataSour... | public Result<List<DataSource>> queryDataSourceList(User loginUser, Integer type){
List<DataSource> datasourceList;
if (isAdmin(loginUser)) {
datasourceList = dataSourceMapper.listAllDataSourceByType(type);
} else {
datasourceList = dataSourceMapper.queryDataSourceByType(loginUser.getId... | |
358 | public static void setShapeType(EntityPlayer player, ItemStack stack, boolean isCurved, int shapeType){
World world = player.worldObj;
if ((isCurved ? Configs.sculptShapeTypeCurved : Configs.sculptShapeTypeFlat).isPerTool()) {
if (!world.isRemote) {
setInt(player, stack, shapeType, NBTKe... | public static void setShapeType(EntityPlayer player, ItemStack stack, boolean isCurved, int shapeType){
World world = player.worldObj;
if ((isCurved ? Configs.sculptShapeTypeCurved : Configs.sculptShapeTypeFlat).isPerTool()) {
if (!world.isRemote)
setInt(player, stack, shapeType, NBTKeys... | |
359 | protected DDMFormField createNestedDDMFormFields(String parentName, String childName){
DDMFormField parentDDMFormField = createTextDDMFormField(parentName);
List<DDMFormField> nestedDDMFormFields = new ArrayList<>();
nestedDDMFormFields.add(createSelectDDMFormField(childName));
parentDDMFormField.se... | protected DDMFormField createNestedDDMFormFields(String parentName, String childName){
DDMFormField parentDDMFormField = createTextDDMFormField(parentName);
parentDDMFormField.setNestedDDMFormFields(Arrays.asList(createSelectDDMFormField(childName)));
return parentDDMFormField;
} | |
360 | public void doNotFail_WhenOsIsNotWindows_And_NoCS_FilesDetected() throws MessageException{
tester = SensorContextTester.create(new File("src/test/resources"));
when(system.isOsWindows()).thenReturn(false);
sensor.execute(tester);
} | public void doNotFail_WhenOsIsNotWindows_And_NoCS_FilesDetected() throws MessageException{
when(system.isOsWindows()).thenReturn(false);
sensor.execute(tester);
} | |
361 | private void exitTwillio(){
if (twillioPhone != null) {
twillioPhone.shutDownTwillio();
twillioPhone.setListeners(null, null, null);
twillioPhone = null;
}
int pid = android.os.Process.myPid();
android.os.Process.killProcess(pid);
} | private void exitTwillio(){
if (twillioPhone != null) {
twillioPhone.shutDownTwillio();
twillioPhone.setListeners(null, null, null);
twillioPhone = null;
}
} | |
362 | public DataType getDataType(Type type){
OriginalType originalType = type.getOriginalType();
if (originalType == OriginalType.DECIMAL) {
return DataType.NUMERIC;
}
return DataType.BIGINT;
} | public DataType getDataType(Type type){
if (type.getLogicalTypeAnnotation() instanceof LogicalTypeAnnotation.DecimalLogicalTypeAnnotation) {
return DataType.NUMERIC;
}
return DataType.BIGINT;
} | |
363 | protected void onProduce(StreamDataAcceptor<T> dataAcceptor){
assert dataAcceptor != null;
if (supplier == null) {
if (!iterator.hasNext()) {
eventloop.post(this::sendEndOfStream);
return;
}
supplier = iterator.next();
internalConsumer = new Intern... | protected void onProduce(@NotNull StreamDataAcceptor<T> dataAcceptor){
if (supplier == null) {
if (!iterator.hasNext()) {
eventloop.post(this::sendEndOfStream);
return;
}
supplier = iterator.next();
internalConsumer = new InternalConsumer();
su... | |
364 | public static String parseEvent(String instruction) throws DukeException, IOException{
String result = "";
if (instruction.length() < 7) {
throw new DukeException("Oops!!! The description of a event cannot be empty.");
} else {
String taskDescription = "";
int currIndex = 5;
... | public static String parseEvent(String instruction) throws DukeException, IOException{
if (instruction.length() < 7) {
throw new DukeException(Ui.EMPTY_EVENT_DESCRIPTION);
} else {
String taskDescription = "";
int currIndex = 5;
while (currIndex < instruction.length() && !i... | |
365 | public void onBeaconServiceConnect(){
RangeNotifier rangeNotifier = (beacons, region) -> {
if (!beacons.isEmpty()) {
System.out.println("didRangeBeaconsInRegion called with beacon count: " + beacons.size());
System.out.println(">>>> RANGING " + Arrays.toString(beacons.toArray(ne... | public void onBeaconServiceConnect(){
RangeNotifier rangeNotifier = (beacons, region) -> {
if (!beacons.isEmpty()) {
Log.d("BeaconRanging", "called with beacon count: " + beacons.size());
Beacon[] beaconsArray = beacons.toArray(new Beacon[] {});
Map<BeaconID, Integer... | |
366 | public void testThatWarningPetstoreSwaggerContainsWarnings() throws IOException{
String specification = resource("/swagger/invalid/warning-petstore.swagger.json");
SwaggerModelInfo info = SwaggerHelper.parse(specification, true);
assertThat(info.getErrors()).isEmpty();
assertThat(info.getWarnings())... | public void testThatWarningPetstoreSwaggerContainsWarnings() throws IOException{
final String specification = resource("/swagger/invalid/warning-petstore.swagger.json");
final SwaggerModelInfo info = SwaggerHelper.parse(specification, true);
assertThat(info.getErrors()).isEmpty();
assertThat(info.ge... | |
367 | public User parseToken(String token){
LOGGER.info("token processing has been started");
try {
Claims body = Jwts.parser().setSigningKey(JwtTokenParams.SECRET).parseClaimsJws(token).getBody();
String username = body.getSubject();
boolean enabled = (Boolean) body.get("isEnabled");
... | public User parseToken(String token) throws Exception{
LOGGER.info("token processing has been started");
Claims body = Jwts.parser().setSigningKey(JwtTokenParams.SECRET).parseClaimsJws(token).getBody();
String username = body.getSubject();
boolean enabled = (Boolean) body.get("isEnabled");
Set<... | |
368 | public void onForceRefresh(){
bookRowItems.clear();
try {
fillListAdapter();
} catch (Exception e) {
Log.e(this.getClass().getSimpleName(), e.getMessage(), e);
}
} | public void onForceRefresh(){
bookRowItems.clear();
fillListAdapter();
} | |
369 | public List<RelationshipVector> getRelationships(final String relationshipName){
List<RelationshipVector> myrelationships = relationships.get(relationshipName.toLowerCase());
ArrayList<RelationshipVector> retRels = new ArrayList<RelationshipVector>(myrelationships);
return retRels;
} | public List<RelationshipVector> getRelationships(final String relationshipName){
List<RelationshipVector> myrelationships = relationships.get(relationshipName.toLowerCase());
return new ArrayList<>(myrelationships);
} | |
370 | public void openSecureChannel(EnumSet<SecurityLevel> securityLevel) throws IOException, JavaCardException{
if (securityLevel.contains(SecurityLevel.C_DECRYPTION) && !securityLevel.contains(SecurityLevel.C_MAC)) {
throw new IllegalArgumentException("C_DECRYPTION must be combined with C_MAC");
}
i... | public void openSecureChannel(EnumSet<SecurityLevel> securityLevel) throws IOException, JavaCardException{
if (securityLevel.contains(SecurityLevel.C_DECRYPTION) && !securityLevel.contains(SecurityLevel.C_MAC)) {
throw new IllegalArgumentException("C_DECRYPTION must be combined with C_MAC");
}
b... | |
371 | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_signup);
etUsernameSignup = findViewById(R.id.etUsernameSignup);
etPasswordSignup = findViewById(R.id.etPasswordSignup);
btnCreateAccount = findViewById(R.id.btnCreateAccount... | protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_signup);
etUsernameSignup = findViewById(R.id.etUsernameSignup);
etPasswordSignup = findViewById(R.id.etPasswordSignup);
btnCreateAccount = findViewById(R.id.btnCreateAccount... | |
372 | public void sendSMS(String smscPDUStr, String pduStr, final Message response){
Rlog.d(TAG, "sendSMS");
if (smscPDUStr == null)
smscPDUStr = "00";
final byte[] smscPDU = IccUtils.hexStringToBytes(smscPDUStr);
final byte[] pdu = IccUtils.hexStringToBytes(pduStr);
runOnDbusThread(new Runn... | public Object sendSMS(String smscPDUStr, String pduStr){
Rlog.d(TAG, "sendSMS");
if (smscPDUStr == null)
smscPDUStr = "00";
final byte[] smscPDU = IccUtils.hexStringToBytes(smscPDUStr);
final byte[] pdu = IccUtils.hexStringToBytes(pduStr);
synchronized (mMapSmsDbusPathToSenderCallback)... | |
373 | private void fetchDataNormalSearch(String query){
searchBooks = new ArrayList<>();
String url = Uri.parse(Constants.LOCAL_BOOK_SEARCH).buildUpon().appendQueryParameter("query", query).build().toString();
final ProgressDialog dialog = new ProgressDialog(this);
dialog.setMessage("Searching");
dia... | private void fetchDataNormalSearch(String query){
searchBooks = new ArrayList<>();
String url = Uri.parse(Constants.LOCAL_BOOK_SEARCH).buildUpon().appendQueryParameter("query", query).build().toString();
AppUtils.getInstance().showProgressDialog(this, "Searching");
JsonObjectRequest jObject = new Js... | |
374 | public Result queryTenantlistPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize){
logger.info("login user {}, list paging, pageN... | public Result<PageListVO<Tenant>> queryTenantlistPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam(value = "searchVal", required = false) String searchVal, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize){
logger.info("login user {}... | |
375 | protected void azureNodeAction(NodeActionEvent event){
try {
springCloudAppNodePresenter.onDeleteApp(id);
} catch (IOException e) {
DefaultLoader.getUIHelper().showException(String.format(FAILED_TO_DELETE_APP, SpringCloudAppNode.this.getName()), e, ERROR_DELETING_APP, false, true);
}
} | protected void azureNodeAction(NodeActionEvent event){
springCloudAppNodePresenter.onDeleteApp(id);
} | |
376 | public Result createProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("projectName") String projectName, @RequestParam(value = "description", required = false) String description){
logger.info("login user {}, create project name: {}, desc: {}", loginUser.getUserName... | public Result<Integer> createProject(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, @RequestParam("projectName") String projectName, @RequestParam(value = "description", required = false) String description){
logger.info("login user {}, create project name: {}, desc: {}", loginUser.ge... | |
377 | protected Optional<PixelDiffFilter> load(final MatchResult regex){
final String value = regex.group(1);
final boolean specifiedAsDouble = value.contains(".");
final double pixelDiff = Double.parseDouble(value);
return Optional.of(new PixelDiffFilter(specifiedAsDouble, pixelDiff));
} | protected Optional<PixelDiffFilter> load(final MatchResult regex){
final String value = regex.group(1);
final double pixelDiff = Double.parseDouble(value);
return Optional.of(new PixelDiffFilter(value, pixelDiff));
} | |
378 | public void run(){
LOGGER_RECEIVER.info("Start the datagramm receiver.");
byte[] receiveBuffer = new byte[512];
while (!exit) {
try {
DatagramPacket packet = new DatagramPacket(receiveBuffer, receiveBuffer.length);
LOGGER_RECEIVER.info("Wait for packet ...");
... | public void run(){
LOGGER_RECEIVER.info("Start the datagramm receiver.");
byte[] receiveBuffer = new byte[512];
while (!exit) {
try {
DatagramPacket packet = new DatagramPacket(receiveBuffer, receiveBuffer.length);
LOGGER_RECEIVER.info("Wait for packet ...");
... | |
379 | protected Boolean removeExistingEntity(String localId){
boolean deleted = false;
try {
ObjectId tempEntId = projectRepo.getProjectIdById(localId).get(0).getId();
if (localId.equalsIgnoreCase(projectRepo.getProjectIdById(localId).get(0).getpId())) {
projectRepo.delete(tempEntId);... | protected Boolean removeExistingEntity(String localId){
boolean deleted = false;
try {
ObjectId tempEntId = projectRepo.getProjectIdById(localId).get(0).getId();
if (localId.equalsIgnoreCase(projectRepo.getProjectIdById(localId).get(0).getpId())) {
projectRepo.delete(tempEntId);... | |
380 | private boolean attemptToBreedCow(final ItemStack currentItemStack, final EntityPlayer entityPlayer){
if (isBreedingItem(currentItemStack) && getGrowingAge() == 0) {
if (!entityPlayer.capabilities.isCreativeMode) {
currentItemStack.shrink(1);
if (currentItemStack.isEmpty()) {
... | private boolean attemptToBreedCow(final ItemStack currentItemStack, final EntityPlayer entityPlayer){
if (isBreedingItem(currentItemStack) && getGrowingAge() == 0) {
consumeItemFromStack(entityPlayer, currentItemStack);
setInLove(entityPlayer);
return true;
}
return false;
} | |
381 | public Program loadProgram(final Id.Program id) throws IOException, ApplicationNotFoundException, ProgramNotFoundException{
ApplicationMeta appMeta = appsTx.get().executeUnchecked(new TransactionExecutor.Function<AppMetadataStore, ApplicationMeta>() {
@Override
public ApplicationMeta apply(AppM... | public ProgramDescriptor loadProgram(final Id.Program id) throws IOException, ApplicationNotFoundException, ProgramNotFoundException{
ApplicationMeta appMeta = appsTx.get().executeUnchecked(new TransactionExecutor.Function<AppMetadataStore, ApplicationMeta>() {
@Override
public ApplicationMeta ... | |
382 | public void processEl187Test(){
StringBuilder xml_ = new StringBuilder();
xml_.append("$public $class pkg.ExTwo {\n");
xml_.append(" $private $int get(Integer... i){\n");
xml_.append(" $return 2i;\n");
xml_.append(" }\n");
xml_.append(" $public $int get(Number... i){\n");
xml_.append... | public void processEl187Test(){
StringBuilder xml_ = new StringBuilder();
xml_.append("$public $class pkg.ExTwo {\n");
xml_.append(" $private $int get(Integer... i){\n");
xml_.append(" $return 2i;\n");
xml_.append(" }\n");
xml_.append(" $public $int get(Number... i){\n");
xml_.append... | |
383 | public void consolidate(@RequestBody final TestSuite test){
if (test == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Test suite is null");
}
if (test.getCpu() == null || test.getMemory() == null || test.getJvm() == null || test.getVendor() == null || test.getOsFamily() == ... | public void consolidate(@RequestBody final TestSuite test){
try {
business.consolidate(TestSuiteBridge.fromProtobuf(test));
} catch (final InvalidParametersException e) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, e.getMessage());
}
} | |
384 | public void onBlockDispensing(final BlockDispenseEvent e){
Block dispenser = e.getBlock();
if (dispenser.getType() == Material.DISPENSER) {
final Dispenser d = (Dispenser) dispenser.getState();
BlockFace face = ((Directional) dispenser.getBlockData()).getFacing();
Block block = disp... | public void onBlockDispensing(final BlockDispenseEvent e){
Block dispenser = e.getBlock();
if (dispenser.getType() == Material.DISPENSER) {
final Dispenser d = (Dispenser) dispenser.getState();
BlockFace face = ((Directional) dispenser.getBlockData()).getFacing();
Block block = disp... | |
385 | public ValueHolder<V> getAndFault(K key) throws CacheAccessException{
getOperationObserver.begin();
checkKey(key);
ValueHolder<V> mappedValue = null;
try {
mappedValue = backingMap().getAndPin(key);
if (mappedValue != null && mappedValue.isExpired(timeSource.getTimeMillis(), TimeUn... | public ValueHolder<V> getAndFault(K key) throws CacheAccessException{
getOperationObserver.begin();
checkKey(key);
ValueHolder<V> mappedValue = null;
try {
mappedValue = backingMap().getAndPin(key);
if (mappedValue != null && mappedValue.isExpired(timeSource.getTimeMillis(), TimeUn... | |
386 | public Login readUniqueObject(String userName, String password){
Login login = null;
System.out.println("in readuniqueobject method");
System.out.println("The username in DAO is: " + userName);
System.out.println("The password in DAO is: " + password);
try {
System.out.println("in USER... | public Login readUniqueObject(String userName, String password){
Login login = null;
try {
System.out.println("in USERDAO");
transaction = session.beginTransaction();
Query query = session.createQuery("FROM Login as login where login.username= :loginName and login.password= :passwor... | |
387 | public void processAnnotation(final JNDIProperty jndiPropertyAnnotation, final Field field, final Object object) throws AnnotationProcessingException{
if (context == null) {
try {
context = new InitialContext();
} catch (NamingException e) {
throw new AnnotationProcessin... | public void processAnnotation(final JNDIProperty jndiPropertyAnnotation, final Field field, final Object object) throws AnnotationProcessingException{
if (context == null) {
try {
context = new InitialContext();
} catch (NamingException e) {
throw new AnnotationProcessin... | |
388 | protected boolean serveStaticOrWebJarRequest(HttpServletRequest request, HttpServletResponse response) throws IOException{
if (staticFileHandler.isStaticResourceRequest(request)) {
staticFileHandler.serveStaticResource(request, response);
return true;
}
return false;
} | protected boolean serveStaticOrWebJarRequest(HttpServletRequest request, HttpServletResponse response) throws IOException{
if (staticFileHandler.serveStaticResource(request, response)) {
return true;
}
return false;
} | |
389 | public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException{
String dotClassName = getDotClassName(className);
if (isIgnoredClassName(dotClassName)) {
return classfileBuffer;
... | public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException{
String dotClassName = getDotClassName(className);
if (isIgnoredClassName(dotClassName)) {
return classfileBuffer;
... | |
390 | public Map<String, Object> querySubProcessInstanceByTaskId(User loginUser, String projectName, Integer taskId){
Map<String, Object> result = new HashMap<>();
Project project = projectMapper.queryByName(projectName);
Map<String, Object> checkResult = projectService.checkProjectAndAuth(loginUser, project, ... | public Result<Map<String, Object>> querySubProcessInstanceByTaskId(User loginUser, String projectName, Integer taskId){
Project project = projectMapper.queryByName(projectName);
CheckParamResult checkResult = projectService.checkProjectAndAuth(loginUser, project, projectName);
if (!Status.SUCCESS.equals(... | |
391 | Argument getCommonSetting(ExecutableCode _conf, Argument _right){
PageEl ip_ = _conf.getOperationPageEl();
setRelativeOffsetPossibleLastPage(getIndexInEl() + off, _conf);
LoopVariable locVar_ = ip_.getVars().getVal(variableName);
Argument left_ = new Argument();
String formattedClassVar_ = loc... | Argument getCommonSetting(ExecutableCode _conf, Argument _right){
PageEl ip_ = _conf.getOperationPageEl();
setRelativeOffsetPossibleLastPage(getIndexInEl() + off, _conf);
LoopVariable locVar_ = ip_.getVars().getVal(variableName);
return ExecMutableLoopVariableOperation.checkSet(_conf, locVar_, _rig... | |
392 | protected void onMeasure(int widthSpec, int heightSpec){
int widthSize = MeasureSpec.getSize(widthSpec);
int heightSize = MeasureSpec.getSize(heightSpec);
int widthMode = MeasureSpec.getMode(widthSpec);
int heightMode = MeasureSpec.getMode(heightSpec);
if (widthMode != MeasureSpec.EXACTLY) {
... | protected void onMeasure(int widthSpec, int heightSpec){
int widthSize = MeasureSpec.getSize(widthSpec);
int heightSize = MeasureSpec.getSize(heightSpec);
int widthMode = MeasureSpec.getMode(widthSpec);
int heightMode = MeasureSpec.getMode(heightSpec);
if (widthMode != MeasureSpec.EXACTLY) {
... | |
393 | public void showLogoInToolbar(){
getSupportActionBar().setTitle("");
if (session == null || session.getInstituteSettings() == null) {
return;
}
String url = session.getInstituteSettings().getAppToolbarLogo();
ImageLoader imageLoader = ImageUtils.initImageLoader(this);
DisplayImage... | public void showLogoInToolbar(){
getSupportActionBar().setTitle("");
if (session == null || session.getInstituteSettings() == null) {
return;
}
UIUtils.loadLogoInView(logo, this);
} | |
394 | private void updateHashrate(float fSpeed, float fMax){
if (!isDeviceMining() || fSpeed < 0.0f)
return;
SpeedView meterTicks = findViewById(R.id.meter_hashrate_ticks);
if (meterTicks.getTickNumber() == 0) {
updateHashrateTicks(fMax);
new Handler().postDelayed(new Runnable() {
... | private void updateHashrate(float fSpeed, float fMax){
if (!isDeviceMining() || fSpeed < 0.0f)
return;
SpeedView meterTicks = findViewById(R.id.meter_hashrate_ticks);
if (meterTicks.getTickNumber() == 0) {
updateHashrateTicks(fMax);
new Handler().postDelayed(() -> updateHashrat... | |
395 | private Query buildQueryForEntity(final Class<? extends BaseDimensionalItemObject> entity, final OrderParams orderParams, final List<String> filters, final WebOptions options){
final Schema schema = schemaService.getDynamicSchema(entity);
final List<Order> orders = orderParams.getOrders(schema);
final Qu... | private Query buildQueryForEntity(final Class<? extends BaseDimensionalItemObject> entity, final OrderParams orderParams, final List<String> filters, final WebOptions options){
final Schema schema = schemaService.getDynamicSchema(entity);
final List<Order> orders = orderParams.getOrders(schema);
final Qu... | |
396 | public void add(T value, int index){
if (index < 0 || index > size) {
throw new ArrayListIndexOutOfBoundsException("Index are not exist, your index is " + index + " last index is " + size);
} else if (index == size && ensureCapacity()) {
arrayData[index] = value;
size++;
} else... | public void add(T value, int index){
if (index < 0 || index > size) {
throw new ArrayListIndexOutOfBoundsException("Index are not exist, your index is " + index + " last index is " + size);
} else if (index == size && ensureCapacity()) {
arrayData[index] = value;
size++;
} else... | |
397 | public List<GenomeMap> getMaps() throws Exception{
List<GenomeMap> mapList = new ArrayList<>();
Pager pager = new Pager();
while (pager.isPaging()) {
Response<BrapiListResource<GenomeMap>> response = service.getMaps(null, null, null, null, null, null, null, pager.getPageSize(), pager.getPage()).... | public List<Map> getMaps() throws Exception{
List<Map> mapList = new ArrayList<>();
Pager pager = new Pager();
while (pager.isPaging()) {
Response<BaseResult<ArrayResult<Map>>> response = genotypeService.getMaps(null, null, null, null, null, null, null, null, pager.getPage(), pager.getPageSize()... | |
398 | public void calculateArgument44FailTest(){
StringBuilder xml_ = new StringBuilder();
xml_.append("$public $class pkg.Ex {\n");
xml_.append(" $public $static $int catching(){\n");
xml_.append(" $switch($true)label{\n");
xml_.append(" $break label;\n");
xml_.append(" }\n");
xml_.app... | public void calculateArgument44FailTest(){
StringBuilder xml_ = new StringBuilder();
xml_.append("$public $class pkg.Ex {\n");
xml_.append(" $public $static $int catching(){\n");
xml_.append(" $switch($true)label{\n");
xml_.append(" $break label;\n");
xml_.append(" }\n");
xml_.app... | |
399 | public List<String> getGenresOfSongBySongID(int songID, Connection connection) throws DataAccessException{
List<String> genres = new ArrayList<>();
String getGenresOfSongQuery = "SELECT genre_name FROM\n" + "(SELECT genre_name, song_id FROM genres_of_songs INNER JOIN genres\n" + "ON genres_of_songs.genre_id =... | public List<String> getGenresOfSongBySongID(int songID, Connection connection) throws DataAccessException{
List<String> genres = new ArrayList<>();
String getGenresOfSongQuery = "SELECT genre_name FROM\n" + "(SELECT genre_name, song_id FROM genres_of_songs INNER JOIN genres\n" + "ON genres_of_songs.genre_id =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.