blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
390
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
35
| license_type
stringclasses 2
values | repo_name
stringlengths 6
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 539
values | visit_date
timestamp[us]date 2016-08-02 21:09:20
2023-09-06 10:10:07
| revision_date
timestamp[us]date 1990-01-30 01:55:47
2023-09-05 21:45:37
| committer_date
timestamp[us]date 2003-07-12 18:48:29
2023-09-05 21:45:37
| github_id
int64 7.28k
684M
⌀ | star_events_count
int64 0
77.7k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 13
values | gha_event_created_at
timestamp[us]date 2012-06-11 04:05:37
2023-09-14 21:59:18
⌀ | gha_created_at
timestamp[us]date 2008-05-22 07:58:19
2023-08-28 02:39:21
⌀ | gha_language
stringclasses 62
values | src_encoding
stringclasses 26
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 128
12.8k
| extension
stringclasses 11
values | content
stringlengths 128
8.19k
| authors
listlengths 1
1
| author_id
stringlengths 1
79
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
71b6fd04a434b0745058d06105d5e6801ad50b0a
|
59e6dc1030446132fb451bd711d51afe0c222210
|
/components/deployment-synchronizer/org.wso2.carbon.deployment.synchronizer/4.2.1/src/main/java/org/wso2/carbon/deployment/synchronizer/internal/util/RepositoryConfigParameter.java
|
f4bd4cb3f5daeff604d6ed1c13df0f9b78b055fd
|
[] |
no_license
|
Alsan/turing-chunk07
|
2f7470b72cc50a567241252e0bd4f27adc987d6e
|
e9e947718e3844c07361797bd52d3d1391d9fb5e
|
refs/heads/master
| 2020-05-26T06:20:24.554039
| 2014-02-07T12:02:53
| 2014-02-07T12:02:53
| 38,284,349
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,187
|
java
|
/*
* Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.deployment.synchronizer.internal.util;
public class RepositoryConfigParameter {
/**
* The name of Parameter.
*/
private String name;
/**
* The value the parameter will be holding
*/
private String value;
/**
* Indicates whether this is a mandatory field or not
*/
private boolean required;
/**
* Whether the field is masked (ex: for password fields)
*/
private boolean masked;
/**
* The maximum number of characters allowed
*/
private int maxlength = 25;
/**
* Type of the parameter (ex: String, Boolean)
*/
private String type;
public boolean isRequired() {
return required;
}
public void setRequired(boolean required) {
this.required = required;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isMasked() {
return masked;
}
public void setMasked(boolean masked) {
this.masked = masked;
}
public int getMaxlength() {
return maxlength;
}
public void setMaxlength(int maxlength) {
this.maxlength = maxlength;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
|
[
"malaka@wso2.com"
] |
malaka@wso2.com
|
fd3660c4adbf42295bd83dc8a58e5109a36e181b
|
549fdc8ff40750cf3147a82d4908d01be4b35939
|
/vacsafe-model/src/main/java/com/redhat/vax/model/EmployeeDiff.java
|
71d4cf5394825fdb80541ac738504eeaf9ced3d2
|
[] |
no_license
|
redhat-na-ssa/vacsafe_demo
|
110f9ea96bc700cf9304f5717220478db05d7c47
|
2ff70e2c8e59d6fed6f39183025a4055834f1ef4
|
refs/heads/main
| 2023-08-30T01:42:48.094670
| 2021-10-22T18:17:00
| 2021-10-22T18:17:00
| 411,605,936
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,749
|
java
|
package com.redhat.vax.model;
public class EmployeeDiff {
private final boolean agencyCodeChanged;
private final boolean agencyNameChanged;
private final boolean divisionCodeChanged;
private final boolean divisionNameChanged;
private final boolean emailChanged;
private final boolean firstNameChanged;
// private final boolean fullTimePartTimeChanged;
private final boolean isHrChanged;
private final boolean lastNameChanged;
// private final boolean middleNameChanged;
// private final boolean ncidChanged;
private final boolean supervisorChanged;
// private final boolean usernameChanged;
// private final boolean userTypeChanged;
public EmployeeDiff(Employee e1, Employee e2) {
agencyCodeChanged = ! same(e1.getAgencyCode(), e2.getAgencyCode());
agencyNameChanged = ! same(e1.getAgencyName(), e2.getAgencyName());
divisionCodeChanged = ! same(e1.getDivisionCode(), e2.getDivisionCode());
divisionNameChanged = ! same(e1.getDivisionName(), e2.getDivisionName());
emailChanged = ! same(e1.getEmail(), e2.getEmail());
firstNameChanged = ! same(e1.getFirstName(), e2.getFirstName());
isHrChanged = ! same(e1.isHR(), e2.isHR());
lastNameChanged = ! same(e1.getLastName(), e2.getLastName());
// middleNameChanged = ! same(e1.getMiddleName(), e2.getMiddleName());
// ncidChanged = ! same(e1.getNcid(), e2.getNcid());
supervisorChanged = ! same(e1.getSupervisor(), e2.getSupervisor());
// usernameChanged = ! same(e1.getUsername(), e2.getUsername());
// userTypeChanged = ! same(e1.getUserType(), e2.getUserType());
// fullTimePartTimeChanged = ! same(e1.getFullTimePartTime(), e2.getFullTimePartTime());
}
public boolean ldapFieldChanged() {
return agencyCodeChanged ||
agencyNameChanged ||
divisionCodeChanged ||
divisionNameChanged ||
emailChanged ||
isHrChanged ||
// fullTimePartTimeChanged ||
firstNameChanged ||
lastNameChanged ||
// middleNameChanged ||
// ncidChanged ||
// usernameChanged ||
// userTypeChanged ||
supervisorChanged;
}
public boolean isAgencyCodeChanged() {
return agencyCodeChanged;
}
public boolean isAgencyNameChanged() {
return agencyNameChanged;
}
public boolean isDivisionCodeChanged() {
return divisionCodeChanged;
}
public boolean isDivisionNameChanged() {
return divisionNameChanged;
}
public boolean isEmailChanged() {
return emailChanged;
}
public boolean isFirstNameChanged() {
return firstNameChanged;
}
// public boolean isFullTimePartTimeChanged() {
// return fullTimePartTimeChanged;
// }
public boolean isHrChanged() {
return isHrChanged;
}
public boolean isLastNameChanged() {
return lastNameChanged;
}
// public boolean isMiddleNameChanged() {
// return middleNameChanged;
// }
// public boolean isNcidChanged() {
// return ncidChanged;
// }
public boolean isSupervisorChanged() {
return supervisorChanged;
}
// public boolean isUsernameChanged() {
// return usernameChanged;
// }
// public boolean isUserTypeChanged() {
// return userTypeChanged;
// }
private boolean same(String s1, String s2) {
return (s1 == null && s2 == null) || (s1 != null && s1.equals(s2));
}
private boolean same(boolean b1, boolean b2) {
return b1 == b2;
}
}
|
[
"jbride2001@yahoo.com"
] |
jbride2001@yahoo.com
|
32a2de55ac415f7d9497efc8f18777efa2d45acd
|
e0b8f71dd73265486111e5cde5b30e848de3059d
|
/code/UIStock/com.bigkoo.convenientbannerdemo/src/com/bigkoo/convenientbannerdemo/LocalImageHolderView.java
|
d68454fb1f0f3554f600b13a84024659b7e3e2ca
|
[] |
no_license
|
geniusgithub/open-project-collect
|
3e10f7b177300b05aa8d921987a1d604afa91cf8
|
ded61afcd38411a79e629b2efbe31658dd62b254
|
refs/heads/master
| 2021-01-22T09:43:10.604811
| 2015-11-18T16:03:43
| 2015-11-18T16:03:43
| 42,772,732
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 721
|
java
|
package com.bigkoo.convenientbannerdemo;
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;
import com.bigkoo.convenientbanner.CBPageAdapter;
/**
* Created by Sai on 15/8/4.
* 本地图片Holder例子
*/
public class LocalImageHolderView implements CBPageAdapter.Holder<Integer>{
private ImageView imageView;
@Override
public View createView(Context context) {
imageView = new ImageView(context);
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
return imageView;
}
@Override
public void UpdateUI(Context context, int position, Integer data) {
imageView.setImageResource(data);
}
}
|
[
"lance.wyj@gmail.com"
] |
lance.wyj@gmail.com
|
27fa3c172f7a93d14873f96f04b937b651dda723
|
8a3ef21e776258ac88d34a8507d22ea78aaa88a2
|
/tests/samples-messaging-jms/src/main/java/com/example/BookDeleter.java
|
32b087745953ec389062bf60ed81d018b0ef73a1
|
[
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] |
permissive
|
Sounie/spring-cloud-contract
|
2cf5bf145fb5aa9b3b9808cb9cf4fd93d053f601
|
ae9436e5d217619ec462ace835446a0796e1f8ae
|
refs/heads/master
| 2020-11-28T13:41:53.634192
| 2019-12-23T22:51:56
| 2019-12-23T22:51:56
| 229,700,852
| 0
| 0
|
Apache-2.0
| 2019-12-23T07:33:33
| 2019-12-23T07:33:32
| null |
UTF-8
|
Java
| false
| false
| 1,696
|
java
|
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.jms.JMSException;
import javax.jms.Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;
@Component
public class BookDeleter {
private static final Logger log = LoggerFactory.getLogger(BookDeleter.class);
private AtomicBoolean bookSuccessfulyDeleted = new AtomicBoolean(false);
/**
* Scenario for "should generate tests triggered by a message": client side: if sends
* a message to input.messageFrom then message will be sent to output.messageFrom
* server side: will send a message to input, verify the message contents and await
* upon receiving message on the output messageFrom
*/
@JmsListener(destination = "delete")
public void bookDeleted(Message message) throws JMSException {
log.info("Deleting book " + message);
this.bookSuccessfulyDeleted.set(true);
log.info("Book successfuly deleted [" + this.bookSuccessfulyDeleted + "]");
}
}
|
[
"marcin@grzejszczak.pl"
] |
marcin@grzejszczak.pl
|
b1a2f6584c5a87c2e3d60f5cbb23086be321403a
|
b69b6701de0b990f95310952e7108066bad33f1f
|
/.history/palindrom_20210430145504.java
|
200d528677f4655c37b9cf52817c7e0721e3598f
|
[] |
no_license
|
deepakadishankar/Practice
|
909551bf369ed286dfde1b6c8e495bc19dc22d7e
|
5725cdd6cb55ae5ff1e6b4607692ef364a3dc267
|
refs/heads/master
| 2023-07-27T07:26:13.783415
| 2021-09-14T07:51:18
| 2021-09-14T07:51:18
| 352,027,381
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 271
|
java
|
public class palindrom {
public static void main(String[] args) {
{
String str = "google";
System.out.println(str.substring(0, 6));
String new_word = word.substring(word.length() - 3);
System.out.println(str.substring(str.length(),-3));
}
}
}
|
[
"tsanthosh@Santhoshs-MacBook-Pro.local"
] |
tsanthosh@Santhoshs-MacBook-Pro.local
|
ce0580c7a161a6c457618bf467012463a8d38279
|
9ad0aa646102f77501efde94d115d4ff8d87422f
|
/LeetCode/java/src/course_schedule/Solution.java
|
8a95f3c4eb314b00cee3a47fc6b12f9cbc0b7663
|
[] |
no_license
|
xiaotdl/CodingInterview
|
cb8fc2b06bf587c83a9683d7b2cb80f5f4fd34ee
|
514e25e83b0cc841f873b1cfef3fcc05f30ffeb3
|
refs/heads/master
| 2022-01-12T05:18:48.825311
| 2022-01-05T19:41:32
| 2022-01-05T19:41:32
| 56,419,795
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,073
|
java
|
package course_schedule;
import java.util.*;
/**
* Created by Xiaotian on 12/23/17.
*/
public class Solution {
// bfs vertices that has indegree == 0
// tag: topological sort
// time: O(mn*m/v), v: avg value in A
// space: O(mn)
public boolean canFinish(int numCourses, int[][] prerequisites) {
int[] indegree = new int[numCourses]; // indegree[i]: indegree of vertice i
List[] edges = new ArrayList[numCourses]; // edges[i]: edges(outbound arrows) of vertice i
for (int i = 0; i < numCourses; i++) {
edges[i] = new ArrayList<Integer>();
}
for (int i = 0; i < prerequisites.length; i++) {
int to = prerequisites[i][0];
int from = prerequisites[i][1]; // prerequisite course
indegree[to]++;
edges[from].add(to);
}
Queue<Integer> queue = new LinkedList<>();
for (int i = 0; i < numCourses; i++) {
if (indegree[i] == 0) {
queue.add(i);
}
}
int count = 0;
while(!queue.isEmpty()) {
int course = queue.poll();
count++;
int size = edges[course].size();
for (int i = 0; i < size; i++) {
int to = (int) edges[course].get(i);
indegree[to]--;
if (indegree[to] == 0) {
queue.add(to);
}
}
}
return count == numCourses;
}
}
class SolutionII {
/*
* @param numCourses: a total of n courses
* @param prerequisites: a list of prerequisite pairs
* @return: true if can finish all courses or false
*/
public boolean canFinish(int numCourses, int[][] prerequisites) {
int[] indegrees = new int[numCourses];
Map<Integer, Set<Integer>> edges = new HashMap<>(); // vertice2connectedVertices
for (int i = 0; i < numCourses; i++) {
edges.put(i, new HashSet<Integer>());
}
for (int i = 0; i < prerequisites.length; i++) {
int to = prerequisites[i][0];
int from = prerequisites[i][1]; // prerequisite course
if (!edges.get(from).contains(to)) { // in case duplicate prerequisites
indegrees[to]++;
}
edges.get(from).add(to);
}
Queue<Integer> q = new LinkedList<>();
for (int i = 0; i < numCourses; i++) {
if (indegrees[i] == 0) {
q.offer(i);
}
}
int count = 0;
while (!q.isEmpty()) {
int size = q.size();
for (int i = 0; i < size; i++){
int course = q.poll();
count++;
for (Integer to : edges.get(course)) {
indegrees[to]--;
if (indegrees[to] == 0) {
q.offer(to);
}
}
}
}
return count == numCourses;
}
}
class SolutionIII {
// topological sort via outdegree, course -> prerequisite course
// tag: topological sort
// time: O(V+E)
// space: O(V+E)
public boolean canFinish(int numCourses, int[][] prerequisites) {
int n = numCourses;
int[] outdegree = new int[n];
Map<Integer, Set<Integer>> graph = new HashMap<>();
for (int i = 0; i < n; i++) graph.put(i, new HashSet<Integer>());
for (int[] p : prerequisites) {
int u = p[0];
int v = p[1];
graph.get(u).add(v);
outdegree[u]++;
}
Queue<Integer> q = new LinkedList<>();
for (int i = 0; i < n; i++) {
if (outdegree[i] == 0) q.offer(i);
}
int cnt = 0;
while (!q.isEmpty()) {
int v = q.poll();
cnt++;
for (int u = 0; u < n; u++) {
if (graph.get(u).contains(v)) {
outdegree[u]--;
if (outdegree[u] == 0) q.offer(u);
}
}
}
return cnt == n;
}
}
class SolutionIV {
// topological sort via indegree, course <- prerequisite course
// tag: topological sort
// time: O(V+E)
// space: O(V+E)
public boolean canFinish(int n, int[][] prerequisites) {
Map<Integer, Set<Integer>> graph = new HashMap<>();
for (int i = 0; i < n; i++) graph.put(i, new HashSet<>());
int[] indegree = new int[n];
for (int[] p : prerequisites) {
int u = p[1];
int v = p[0];
graph.get(u).add(v);
indegree[v]++;
}
Queue<Integer> q = new LinkedList<>();
for (int i = 0; i < n; i++) {
if (indegree[i] == 0) q.offer(i);
}
int cnt = 0;
while (!q.isEmpty()) {
int u = q.poll();
cnt++;
for (int v : graph.get(u)) {
indegree[v]--;
if (indegree[v] == 0) q.offer(v);
}
}
return cnt == n;
}
}
|
[
"xiaotdl@gmail.com"
] |
xiaotdl@gmail.com
|
68c061c6086cd82f554e871c65d2883bcdba0c5c
|
3becd05372c5681346dbb3d6230cd2ff17bb8577
|
/temp/src/minecraft_server/net/minecraft/server/gui/MinecraftServerGui.java
|
93e553372c87a649a4e5b023f670e5794f822299
|
[] |
no_license
|
payton/learn-to-save
|
0e5a2cc4b56148a1b1ed9a0999eae94bb3abd97a
|
b308bce374ea66925d0e60af2df1ea73e7b44440
|
refs/heads/master
| 2022-01-29T14:38:44.649052
| 2017-04-16T15:15:19
| 2017-04-16T15:15:19
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,952
|
java
|
package net.minecraft.server.gui;
import com.mojang.util.QueueLogAppender;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.border.EtchedBorder;
import javax.swing.border.TitledBorder;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import net.minecraft.server.dedicated.DedicatedServer;
import net.minecraft.server.gui.PlayerListComponent;
import net.minecraft.server.gui.StatsComponent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class MinecraftServerGui extends JComponent {
private static final Font field_164249_a = new Font("Monospaced", 0, 12);
private static final Logger field_164248_b = LogManager.getLogger();
private final DedicatedServer field_120021_b;
public static void func_120016_a(final DedicatedServer p_120016_0_) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception var3) {
;
}
MinecraftServerGui minecraftservergui = new MinecraftServerGui(p_120016_0_);
JFrame jframe = new JFrame("Minecraft server");
jframe.add(minecraftservergui);
jframe.pack();
jframe.setLocationRelativeTo((Component)null);
jframe.setVisible(true);
jframe.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent p_windowClosing_1_) {
p_120016_0_.func_71263_m();
while(!p_120016_0_.func_71241_aa()) {
try {
Thread.sleep(100L);
} catch (InterruptedException interruptedexception) {
interruptedexception.printStackTrace();
}
}
System.exit(0);
}
});
}
public MinecraftServerGui(DedicatedServer p_i2362_1_) {
this.field_120021_b = p_i2362_1_;
this.setPreferredSize(new Dimension(854, 480));
this.setLayout(new BorderLayout());
try {
this.add(this.func_120018_d(), "Center");
this.add(this.func_120019_b(), "West");
} catch (Exception exception) {
field_164248_b.error((String)"Couldn\'t build server GUI", (Throwable)exception);
}
}
private JComponent func_120019_b() throws Exception {
JPanel jpanel = new JPanel(new BorderLayout());
jpanel.add(new StatsComponent(this.field_120021_b), "North");
jpanel.add(this.func_120020_c(), "Center");
jpanel.setBorder(new TitledBorder(new EtchedBorder(), "Stats"));
return jpanel;
}
private JComponent func_120020_c() throws Exception {
JList jlist = new PlayerListComponent(this.field_120021_b);
JScrollPane jscrollpane = new JScrollPane(jlist, 22, 30);
jscrollpane.setBorder(new TitledBorder(new EtchedBorder(), "Players"));
return jscrollpane;
}
private JComponent func_120018_d() throws Exception {
JPanel jpanel = new JPanel(new BorderLayout());
final JTextArea jtextarea = new JTextArea();
final JScrollPane jscrollpane = new JScrollPane(jtextarea, 22, 30);
jtextarea.setEditable(false);
jtextarea.setFont(field_164249_a);
final JTextField jtextfield = new JTextField();
jtextfield.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent p_actionPerformed_1_) {
String s = jtextfield.getText().trim();
if(!s.isEmpty()) {
MinecraftServerGui.this.field_120021_b.func_71331_a(s, MinecraftServerGui.this.field_120021_b);
}
jtextfield.setText("");
}
});
jtextarea.addFocusListener(new FocusAdapter() {
public void focusGained(FocusEvent p_focusGained_1_) {
}
});
jpanel.add(jscrollpane, "Center");
jpanel.add(jtextfield, "South");
jpanel.setBorder(new TitledBorder(new EtchedBorder(), "Log and chat"));
Thread thread = new Thread(new Runnable() {
public void run() {
String s;
while((s = QueueLogAppender.getNextLogEvent("ServerGuiConsole")) != null) {
MinecraftServerGui.this.func_164247_a(jtextarea, jscrollpane, s);
}
}
});
thread.setDaemon(true);
thread.start();
return jpanel;
}
public void func_164247_a(final JTextArea p_164247_1_, final JScrollPane p_164247_2_, final String p_164247_3_) {
if(!SwingUtilities.isEventDispatchThread()) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
MinecraftServerGui.this.func_164247_a(p_164247_1_, p_164247_2_, p_164247_3_);
}
});
} else {
Document document = p_164247_1_.getDocument();
JScrollBar jscrollbar = p_164247_2_.getVerticalScrollBar();
boolean flag = false;
if(p_164247_2_.getViewport().getView() == p_164247_1_) {
flag = (double)jscrollbar.getValue() + jscrollbar.getSize().getHeight() + (double)(field_164249_a.getSize() * 4) > (double)jscrollbar.getMaximum();
}
try {
document.insertString(document.getLength(), p_164247_3_, (AttributeSet)null);
} catch (BadLocationException var8) {
;
}
if(flag) {
jscrollbar.setValue(Integer.MAX_VALUE);
}
}
}
}
|
[
"pgarland2@wisc.edu"
] |
pgarland2@wisc.edu
|
9a16648662248fabae19efbe36d10f26533482f4
|
07efa03a2f3bdaecb69c2446a01ea386c63f26df
|
/eclipse_jee/Pdf/AS400/com/idc/rm/equipmentOnRent/EquipmentOnRentTest.java
|
73d15e068d9b1abd0b6503bd66de75041af7c71c
|
[] |
no_license
|
johnvincentio/repo-java
|
cc21e2b6e4d2bed038e2f7138bb8a269dfabeb2c
|
1824797cb4e0c52e0945248850e40e20b09effdd
|
refs/heads/master
| 2022-07-08T18:14:36.378588
| 2020-01-29T20:55:49
| 2020-01-29T20:55:49
| 84,679,095
| 0
| 0
| null | 2022-06-30T20:11:56
| 2017-03-11T20:51:46
|
Java
|
UTF-8
|
Java
| false
| false
| 4,319
|
java
|
package com.idc.rm.equipmentOnRent;
import java.util.Calendar;
/*
* equipOnRent.jsp; use eqdetailhistoryBean, renamed to EquipmentDetailHistoryBean. Also uses PendingTransactionsBean.
*/
public class EquipmentOnRentTest {
public static void main (String[] args) {
try {
long start = System.currentTimeMillis();
(new EquipmentOnRentTest()).doTest1();
System.out.println("test total time : " + (System.currentTimeMillis() - start));
}
catch (Exception ex) {
System.out.println("Exception; "+ex.getMessage());
}
}
private void doTest1() throws Exception {
System.out.println(">>> doTest1 - 1");
boolean bEquipmentOnRent = true; // Overdue = false;
Calendar Today = Calendar.getInstance();
int todayDate = Today.get(Calendar.YEAR)*10000 + (Today.get(Calendar.MONTH)+1)*100 + Today.get(Calendar.DAY_OF_MONTH);
int countryCode = 1; // US
EquipmentOnRentInfo equipmentOnRentInfo = new EquipmentOnRentInfo (countryCode);
boolean bEquipmentChangeAuthorization = true;
boolean bAllowReleases = true;
boolean bAllowExtend = true;
String list_customer = "2628275";
String accountNumber = "2628275";
String accountName = "xxxxxxxxxx"; // account name from RM
equipmentOnRentInfo = doAccount (bEquipmentOnRent, bEquipmentChangeAuthorization, bAllowReleases, bAllowExtend, todayDate, equipmentOnRentInfo, list_customer, accountNumber, accountName, countryCode);
list_customer = "804716";
accountNumber = "804716";
accountName = "yyyyyyyyyyyyyyyyyy"; // account name from RM
equipmentOnRentInfo = doAccount (bEquipmentOnRent, bEquipmentChangeAuthorization, bAllowReleases, bAllowExtend, todayDate, equipmentOnRentInfo, list_customer, accountNumber, accountName, countryCode);
StringBuffer buf = equipmentOnRentInfo.getCSV (true);
System.out.println("CSV: \n"+buf.toString());
System.out.println("<<< doTest1 - 1");
}
private EquipmentOnRentInfo doAccount (boolean bEquipmentOnRent,
boolean bEquipmentChangeAuthorization, boolean bAllowReleases, boolean bAllowExtend,
int todayDate, EquipmentOnRentInfo equipmentOnRentInfo,
String list_customer, String accountNumber, String accountName, int countryCode) throws Exception {
System.out.println(">>> doAccount");
String jobnumber = "";
String str_OrderBy = "";
PendingTransactionsBean pendingTransactionsBean = new PendingTransactionsBean();
pendingTransactionsBean.makeConnection();
PendingTransactionsInfo pendingTransactionsInfo = new PendingTransactionsInfo();
if (bEquipmentChangeAuthorization && (bAllowReleases || bAllowExtend)) {
if (countryCode == 1) {
if (pendingTransactionsBean.getPendingTrans(accountNumber, countryCode)) {
while (pendingTransactionsBean.getNext()) {
pendingTransactionsInfo.add (pendingTransactionsBean);
}
}
}
}
pendingTransactionsBean.cleanup();
pendingTransactionsBean.endConnection();
EquipmentOnRentBean equipmentOnRentBean = new EquipmentOnRentBean();
equipmentOnRentBean.makeConnection();
EquipmentOnRentPickupInfo equipmentOnRentPickupInfo = new EquipmentOnRentPickupInfo();
if (equipmentOnRentBean.getPickup (list_customer, accountNumber, countryCode)) {
while (equipmentOnRentBean.getNext3()) {
equipmentOnRentPickupInfo.add (new EquipmentOnRentPickupItemInfo(equipmentOnRentBean));
}
}
if (equipmentOnRentBean.getRows (list_customer, countryCode, jobnumber, str_OrderBy)) {
while (equipmentOnRentBean.getNext()) {
EquipmentOnRentItemInfo equipmentOnRentItemInfo =
new EquipmentOnRentItemInfo (countryCode, accountNumber, accountName, todayDate,
equipmentOnRentBean, equipmentOnRentPickupInfo, pendingTransactionsInfo);
if (equipmentOnRentItemInfo.isReRentItem()) {
equipmentOnRentItemInfo.setItemComments (equipmentOnRentBean.getItemComments (countryCode,
equipmentOnRentItemInfo.getContractNumber(), equipmentOnRentItemInfo.getDetailSequence()));
}
if (bEquipmentOnRent || equipmentOnRentItemInfo.isOverdueContract())
equipmentOnRentInfo.add (equipmentOnRentItemInfo);
}
}
equipmentOnRentBean.cleanup();
equipmentOnRentBean.endConnection();
System.out.println("<<< doAccount");
return equipmentOnRentInfo;
}
}
|
[
"john@johnvincent.io"
] |
john@johnvincent.io
|
8af5b0a23fa3133870d72b87d449f49022898e7d
|
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
|
/benchmark/training/org/graylog2/contentpacks/ContentPackPersistenceServiceTest.java
|
dc647b52caddc0b64e7c50ec498625558a3333cd
|
[] |
no_license
|
STAMP-project/dspot-experiments
|
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
|
121487e65cdce6988081b67f21bbc6731354a47f
|
refs/heads/master
| 2023-02-07T14:40:12.919811
| 2019-11-06T07:17:09
| 2019-11-06T07:17:09
| 75,710,758
| 14
| 19
| null | 2023-01-26T23:57:41
| 2016-12-06T08:27:42
| null |
UTF-8
|
Java
| false
| false
| 7,659
|
java
|
/**
* This file is part of Graylog.
*
* Graylog is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Graylog is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Graylog. If not, see <http://www.gnu.org/licenses/>.
*/
package org.graylog2.contentpacks;
import com.google.common.collect.ImmutableSet;
import com.lordofthejars.nosqlunit.annotation.UsingDataSet;
import com.lordofthejars.nosqlunit.core.LoadStrategyEnum;
import com.lordofthejars.nosqlunit.mongodb.InMemoryMongoDb;
import java.net.URI;
import java.util.Optional;
import java.util.Set;
import org.graylog2.contentpacks.model.ContentPack;
import org.graylog2.contentpacks.model.ContentPackV1;
import org.graylog2.contentpacks.model.ModelId;
import org.graylog2.database.MongoConnectionRule;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
public class ContentPackPersistenceServiceTest {
@ClassRule
public static final InMemoryMongoDb IN_MEMORY_MONGO_DB = newInMemoryMongoDbRule().build();
@Rule
public final MongoConnectionRule mongoRule = MongoConnectionRule.build("content_packs");
private ContentPackPersistenceService contentPackPersistenceService;
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.CLEAN_INSERT)
public void loadAll() {
final Set<ContentPack> contentPacks = contentPackPersistenceService.loadAll();
assertThat(contentPacks).hasSize(5);
}
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.CLEAN_INSERT)
public void loadAllLatest() {
final Set<ContentPack> contentPacks = contentPackPersistenceService.loadAllLatest();
assertThat(contentPacks).hasSize(3).anyMatch(( contentPack) -> (contentPack.id().equals(ModelId.of("dcd74ede-6832-4ef7-9f69-deadbeef0000"))) && ((contentPack.revision()) == 3));
}
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.CLEAN_INSERT)
public void findAllById() {
final Set<ContentPack> contentPacks = contentPackPersistenceService.findAllById(ModelId.of("dcd74ede-6832-4ef7-9f69-deadbeef0000"));
assertThat(contentPacks).hasSize(3).allMatch(( contentPack) -> contentPack.id().equals(ModelId.of("dcd74ede-6832-4ef7-9f69-deadbeef0000")));
}
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.CLEAN_INSERT)
public void findAllByIdWithInvalidId() {
final Set<ContentPack> contentPacks = contentPackPersistenceService.findAllById(ModelId.of("does-not-exist"));
assertThat(contentPacks).isEmpty();
}
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.CLEAN_INSERT)
public void findByIdAndRevision() {
final Optional<ContentPack> contentPack = contentPackPersistenceService.findByIdAndRevision(ModelId.of("dcd74ede-6832-4ef7-9f69-deadbeef0000"), 2);
assertThat(contentPack).isPresent().get().matches(( c) -> c.id().equals(ModelId.of("dcd74ede-6832-4ef7-9f69-deadbeef0000")));
}
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.CLEAN_INSERT)
public void findByIdAndRevisionWithInvalidId() {
final Optional<ContentPack> contentPack = contentPackPersistenceService.findByIdAndRevision(ModelId.of("does-not-exist"), 2);
assertThat(contentPack).isEmpty();
}
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.CLEAN_INSERT)
public void findByIdAndRevisionWithInvalidRevision() {
final Optional<ContentPack> contentPack = contentPackPersistenceService.findByIdAndRevision(ModelId.of("dcd74ede-6832-4ef7-9f69-deadbeef0000"), 42);
assertThat(contentPack).isEmpty();
}
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.DELETE_ALL)
public void insert() {
final ContentPackV1 contentPack = ContentPackV1.builder().id(ModelId.of("id")).revision(1).name("name").description("description").summary("summary").vendor("vendor").url(URI.create("https://www.graylog.org/")).entities(ImmutableSet.of()).build();
final Optional<ContentPack> savedContentPack = contentPackPersistenceService.insert(contentPack);
assertThat(savedContentPack).isPresent().get().isEqualToIgnoringGivenFields(contentPack, "_id");
}
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.DELETE_ALL)
public void insertDuplicate() {
final ContentPackV1 contentPack = ContentPackV1.builder().id(ModelId.of("id")).revision(1).name("name").description("description").summary("summary").vendor("vendor").url(URI.create("https://www.graylog.org/")).entities(ImmutableSet.of()).build();
contentPackPersistenceService.insert(contentPack);
final Optional<ContentPack> savedContentPack2 = contentPackPersistenceService.insert(contentPack);
assertThat(savedContentPack2).isEmpty();
}
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.CLEAN_INSERT)
public void deleteById() {
final int deletedContentPacks = contentPackPersistenceService.deleteById(ModelId.of("dcd74ede-6832-4ef7-9f69-deadbeef0000"));
final Set<ContentPack> contentPacks = contentPackPersistenceService.loadAll();
assertThat(deletedContentPacks).isEqualTo(3);
assertThat(contentPacks).hasSize(2).noneMatch(( contentPack) -> contentPack.id().equals(ModelId.of("dcd74ede-6832-4ef7-9f69-deadbeef0000")));
}
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.CLEAN_INSERT)
public void deleteByIdWithInvalidId() {
final int deletedContentPacks = contentPackPersistenceService.deleteById(ModelId.of("does-not-exist"));
final Set<ContentPack> contentPacks = contentPackPersistenceService.loadAll();
assertThat(deletedContentPacks).isEqualTo(0);
assertThat(contentPacks).hasSize(5);
}
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.CLEAN_INSERT)
public void deleteByIdAndRevision() {
final int deletedContentPacks = contentPackPersistenceService.deleteByIdAndRevision(ModelId.of("dcd74ede-6832-4ef7-9f69-deadbeef0000"), 2);
final Set<ContentPack> contentPacks = contentPackPersistenceService.loadAll();
assertThat(deletedContentPacks).isEqualTo(1);
assertThat(contentPacks).hasSize(4).noneMatch(( contentPack) -> (contentPack.id().equals(ModelId.of("dcd74ede-6832-4ef7-9f69-deadbeef0000"))) && ((contentPack.revision()) == 2));
}
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.CLEAN_INSERT)
public void deleteByIdAndRevisionWithInvalidId() {
final int deletedContentPacks = contentPackPersistenceService.deleteByIdAndRevision(ModelId.of("does-not-exist"), 2);
final Set<ContentPack> contentPacks = contentPackPersistenceService.loadAll();
assertThat(deletedContentPacks).isEqualTo(0);
assertThat(contentPacks).hasSize(5);
}
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.CLEAN_INSERT)
public void deleteByIdAndRevisionWithInvalidRevision() {
final int deletedContentPacks = contentPackPersistenceService.deleteByIdAndRevision(ModelId.of("dcd74ede-6832-4ef7-9f69-deadbeef0000"), 42);
final Set<ContentPack> contentPacks = contentPackPersistenceService.loadAll();
assertThat(deletedContentPacks).isEqualTo(0);
assertThat(contentPacks).hasSize(5);
}
}
|
[
"benjamin.danglot@inria.fr"
] |
benjamin.danglot@inria.fr
|
2290f574822d76849992aa99e3c2173a5c05124b
|
be73270af6be0a811bca4f1710dc6a038e4a8fd2
|
/crash-reproduction-moho/results/CHART-13b-3-19-FEMO-WeightedSum:TestLen:CallDiversity/org/jfree/chart/block/BorderArrangement_ESTest_scaffolding.java
|
d2e68b9b62053549c6b475c790c7399b065b1214
|
[] |
no_license
|
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
|
cf118b23ecb87a8bf59643e42f7556b521d1f754
|
3bb39683f9c343b8ec94890a00b8f260d158dfe3
|
refs/heads/master
| 2022-07-29T14:44:00.774547
| 2020-08-10T15:14:49
| 2020-08-10T15:14:49
| 285,804,495
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 443
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Mon Jan 20 12:48:16 UTC 2020
*/
package org.jfree.chart.block;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class BorderArrangement_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
973d17e29d8a2a77cb8ed5e5665d83ca8ee362fa
|
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
|
/crash-reproduction-new-fitness/results/MATH-90b-1-21-Single_Objective_GGA-IntegrationSingleObjective-/org/apache/commons/math/stat/Frequency_ESTest_scaffolding.java
|
d4f80ee15f1da0323e82a25ed43d95b1665f8717
|
[
"MIT",
"CC-BY-4.0"
] |
permissive
|
STAMP-project/Botsing-basic-block-coverage-application
|
6c1095c6be945adc0be2b63bbec44f0014972793
|
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
|
refs/heads/master
| 2022-07-28T23:05:55.253779
| 2022-04-20T13:54:11
| 2022-04-20T13:54:11
| 285,771,370
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,388
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Mon May 18 03:34:33 UTC 2020
*/
package org.apache.commons.math.stat;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import static org.evosuite.shaded.org.mockito.Mockito.*;
@EvoSuiteClassExclude
public class Frequency_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.math.stat.Frequency";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
try { initMocksToAvoidTimeoutsInTheTests(); } catch(ClassNotFoundException e) {}
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(Frequency_ESTest_scaffolding.class.getClassLoader() ,
"org.apache.commons.math.stat.Frequency$NaturalComparator",
"org.apache.commons.math.stat.Frequency",
"org.apache.commons.math.stat.Frequency$1"
);
}
private static void initMocksToAvoidTimeoutsInTheTests() throws ClassNotFoundException {
mock(Class.forName("java.util.Comparator", false, Frequency_ESTest_scaffolding.class.getClassLoader()));
}
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
3f14aaf5b19f3b8ca1a8505dfdd6d9568b883afe
|
612b1b7f5201f3ff1a550b09c96218053e195519
|
/modules/core/src/com/haulmont/cuba/core/jmx/FileStorageMBean.java
|
0dce0f00a1829036ad75371fb24cdabcbf992f72
|
[
"Apache-2.0"
] |
permissive
|
cuba-platform/cuba
|
ffb83fe0b089056e8da11d96a40c596d8871d832
|
36e0c73d4e3b06f700173c4bc49c113838c1690b
|
refs/heads/master
| 2023-06-24T02:03:12.525885
| 2023-06-19T14:13:06
| 2023-06-19T14:13:06
| 54,624,511
| 1,434
| 303
|
Apache-2.0
| 2023-08-31T18:57:38
| 2016-03-24T07:55:56
|
Java
|
UTF-8
|
Java
| false
| false
| 1,209
|
java
|
/*
* Copyright (c) 2008-2016 Haulmont.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.haulmont.cuba.core.jmx;
import java.io.File;
/**
* JMX interface for {@link com.haulmont.cuba.core.app.FileStorageAPI}.
*
*/
public interface FileStorageMBean {
/**
* @return the root directories of all registered storages
*/
File[] getStorageRoots();
/**
* @return the list of file descriptors in the database which have no corresponding files in the storage
*/
String findOrphanDescriptors();
/**
* @return the list of files in the storage which have no corresponding descriptors in the database
*/
String findOrphanFiles();
}
|
[
"artamonov@haulmont.com"
] |
artamonov@haulmont.com
|
3fa48f826cf7065c1604a5afff11d9909d69c60f
|
7a59b9ec325f0a65382f01a15681ce875fb03601
|
/cc-control-ui/src/main/java/cc/creativecomputing/controlui/controls/CCValueControl.java
|
3ad5ec3ea16b825b6df2a15ba17bbf60d5e7c155
|
[] |
no_license
|
dereksx/creativecomputing
|
37f67a2d39e712588c7bf68682ef53bfa85ab2d0
|
79c920b1378255e8f10b310c271dfbe71c9cf2c4
|
refs/heads/master
| 2021-05-16T08:11:31.359609
| 2017-09-06T12:51:10
| 2017-09-06T12:51:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,073
|
java
|
package cc.creativecomputing.controlui.controls;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import cc.creativecomputing.control.handles.CCPropertyHandle;
import cc.creativecomputing.controlui.CCControlComponent;
import cc.creativecomputing.controlui.CCPropertyPopUp;
public abstract class CCValueControl<Type, Handle extends CCPropertyHandle<Type>> implements CCControl{
protected Handle _myHandle;
protected JLabel _myLabel;
protected CCPropertyPopUp _myPopUp;
protected CCControlComponent _myControlComponent;
public CCValueControl(Handle theHandle, CCControlComponent theControlComponent){
_myHandle = theHandle;
_myControlComponent = theControlComponent;
_myPopUp = new CCPropertyPopUp(theHandle, _myControlComponent);
//Create the label.
_myLabel = new JLabel(_myHandle.name(), JLabel.LEFT);
_myLabel.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
if(e.isAltDown()){
_myHandle.restoreDefault();
return;
}
if(e.isControlDown()){
_myHandle.restorePreset();
return;
}
if(e.getButton() == MouseEvent.BUTTON3){
_myPopUp.show(_myLabel, e.getX(), e.getY());
}
}
});
CCUIStyler.styleLabel(_myLabel);
}
protected GridBagConstraints constraints(int theX, int theY, int theWidth, int theAnchor, int theTop, int theLeft, int theBottom, int theRight){
GridBagConstraints myResult = new GridBagConstraints();
myResult.gridx = theX;
myResult.gridy = theY;
myResult.gridwidth = theWidth;
myResult.insets = new Insets(theTop, theLeft, theBottom, theRight);
myResult.anchor = theAnchor;
return myResult;
}
protected GridBagConstraints constraints(int theX, int theY, int theAnchor, int theTop, int theLeft, int theBottom, int theRight){
return constraints(theX, theY, 1, theAnchor, theTop, theLeft, theBottom, theRight);
}
public abstract Type value();
}
|
[
"info@texone.org"
] |
info@texone.org
|
a42ca51b3221ff0daaa6eaf315a2adc747d8ac76
|
ffc3c5e51d0ac126c2a36e6ac45f7a6a0eda9164
|
/src/main/java/wenyu/learning/Tree/BinaryTree/VerifyBST.java
|
334b328eb18f01f01a32f3736d8d37f05aaa46e7
|
[] |
no_license
|
WenyuChang/data-structure-algorithm-leaning
|
203646bd537542e4cd33ca2b549e497e90d97297
|
9f9df7eb6d438493a1a91c87c766969a1f2147d9
|
refs/heads/master
| 2021-01-22T20:08:05.117890
| 2017-03-17T07:20:14
| 2017-03-17T07:20:14
| 85,282,459
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,064
|
java
|
package wenyu.learning.Tree.BinaryTree;
import java.util.Stack;
/*
* Check if the given binary tree is BST or not.
*/
public class VerifyBST {
public static <E extends Comparable<E>> boolean verify(BinaryTreeNode<E> root) {
if(root == null) {
return true;
}
Stack<BinaryTreeNode<E>> stack = new Stack<BinaryTreeNode<E>>();
stack.push(root);
BinaryTreeNode<E> pre = null;
while(!stack.isEmpty()) {
BinaryTreeNode<E> node = stack.peek();
while(node!=null) {
stack.push(node.left);
node = node.left;
}
stack.pop(); //Pop out null peek value
if(!stack.isEmpty()) {
node = stack.pop();
if(pre!=null && node.value.compareTo(pre.value)<=0) {
return false;
}
stack.push(node.right);
pre = node;
}
}
return true;
}
public static <E extends Comparable<E>> boolean verifyRecursion(BinaryTreeNode<E> node, E min, E max) {
if(node==null) {
return true;
}
// Attention the case that min or max is the min or max value of E (e.g. min or max value of integer)
if((max == null || node.value.compareTo(max)<0) && (min == null || node.value.compareTo(min)>0)) {
boolean left = verifyRecursion(node.left, min, node.value);
boolean right = verifyRecursion(node.right, node.value, max);
return left&&right;
} else {
return false;
}
}
public static void main(String[] args) {
BinaryTreeNode<Integer> root = new BinaryTreeNode<Integer>(9);
root.left = new BinaryTreeNode<Integer>(6);
root.right = new BinaryTreeNode<Integer>(13);
root.left.left = new BinaryTreeNode<Integer>(3);
root.left.right = new BinaryTreeNode<Integer>(8);
boolean result = verifyRecursion(root, null, null);
if(result) {
System.out.println("Is Binary Search Tree");
} else {
System.out.println("Is not Binary Search Tree");
}
result = verify(root);
if(result) {
System.out.println("Is Binary Search Tree");
} else {
System.out.println("Is not Binary Search Tree");
}
}
}
|
[
"changwy_1987@hotmail.com"
] |
changwy_1987@hotmail.com
|
cb6f3532edc9c0ab0dacd449432aba63f0996cb1
|
12561c64b92aa31446ad77295c71be5f73fc1c6e
|
/src/test/java/com/bnet/ironart/security/SecurityUtilsUnitTest.java
|
8d149e9be0912eb137fcaa07b9cc706d1699956d
|
[] |
no_license
|
BNet-Dv/jhipster-sample-application
|
02f971380447fc439aebda675a2bc9816972a0f4
|
5ec6101c5767b8df4b89434717c7b28ffb2e9f0b
|
refs/heads/master
| 2022-12-24T19:04:13.887823
| 2020-10-06T08:50:06
| 2020-10-06T08:50:06
| 301,666,804
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,196
|
java
|
package com.bnet.ironart.security;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Optional;
import org.junit.jupiter.api.Test;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
/**
* Test class for the {@link SecurityUtils} utility class.
*/
public class SecurityUtilsUnitTest {
@Test
public void testGetCurrentUserLogin() {
SecurityContext securityContext = SecurityContextHolder.createEmptyContext();
securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("admin", "admin"));
SecurityContextHolder.setContext(securityContext);
Optional<String> login = SecurityUtils.getCurrentUserLogin();
assertThat(login).contains("admin");
}
@Test
public void testgetCurrentUserJWT() {
SecurityContext securityContext = SecurityContextHolder.createEmptyContext();
securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("admin", "token"));
SecurityContextHolder.setContext(securityContext);
Optional<String> jwt = SecurityUtils.getCurrentUserJWT();
assertThat(jwt).contains("token");
}
@Test
public void testIsAuthenticated() {
SecurityContext securityContext = SecurityContextHolder.createEmptyContext();
securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("admin", "admin"));
SecurityContextHolder.setContext(securityContext);
boolean isAuthenticated = SecurityUtils.isAuthenticated();
assertThat(isAuthenticated).isTrue();
}
@Test
public void testAnonymousIsNotAuthenticated() {
SecurityContext securityContext = SecurityContextHolder.createEmptyContext();
Collection<GrantedAuthority> authorities = new ArrayList<>();
authorities.add(new SimpleGrantedAuthority(AuthoritiesConstants.ANONYMOUS));
securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("anonymous", "anonymous", authorities));
SecurityContextHolder.setContext(securityContext);
boolean isAuthenticated = SecurityUtils.isAuthenticated();
assertThat(isAuthenticated).isFalse();
}
@Test
public void testIsCurrentUserInRole() {
SecurityContext securityContext = SecurityContextHolder.createEmptyContext();
Collection<GrantedAuthority> authorities = new ArrayList<>();
authorities.add(new SimpleGrantedAuthority(AuthoritiesConstants.USER));
securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("user", "user", authorities));
SecurityContextHolder.setContext(securityContext);
assertThat(SecurityUtils.isCurrentUserInRole(AuthoritiesConstants.USER)).isTrue();
assertThat(SecurityUtils.isCurrentUserInRole(AuthoritiesConstants.ADMIN)).isFalse();
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
08019bd97e305a14c4c1ef0dd1a1dc3643c1f5e5
|
c0d288a00c4c9b2f4a783e57c8df9530d425b9f5
|
/src/main/java/net/canang/cca/core/model/impl/CaSalesPersonImpl.java
|
e40ffc8b0ac08a5bfefc7bfa1628dbb34f96a868
|
[] |
no_license
|
rafizanbaharum/CCA
|
9093965d0dd6221b8f64acf84f806ba2adaa49a2
|
31e7cbea77ed4ecabce098fa428b3c29045ba30a
|
refs/heads/master
| 2020-05-20T13:53:17.251361
| 2013-06-05T02:10:24
| 2013-06-05T02:10:24
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 356
|
java
|
package net.canang.cca.core.model.impl;
import net.canang.cca.core.model.CaSalesPerson;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @author rafizan.baharum
* @since 5/24/13
*/
@Entity(name = "CaSalesperson")
@Table(name = "CA_SALESPERSON")
public class CaSalesPersonImpl extends CaConsumerImpl implements CaSalesPerson {
}
|
[
"rafizan.baharum@gmail.com"
] |
rafizan.baharum@gmail.com
|
b40b609599e6b6a597fcbe27a3b9785f2d16f632
|
b308232b5f9a1acd400fe15b45780e348048fccd
|
/LIS/src/main/java/com/param/lis/histopathology/transaction/dao/IRestainingRequestDetailsDao.java
|
840f52e1b6ef2a303640bd62c014d930d8027d1c
|
[] |
no_license
|
PravatKumarPradhan/his
|
2aae12f730b7d652b9590ef976b12443fc2c2afb
|
afb2b3df65c0bc1b1864afc1f958ca36a2562e3f
|
refs/heads/master
| 2022-12-22T20:43:44.895342
| 2018-07-31T17:04:26
| 2018-07-31T17:04:26
| 143,041,254
| 1
| 0
| null | 2022-12-16T03:59:53
| 2018-07-31T16:43:36
|
HTML
|
UTF-8
|
Java
| false
| false
| 689
|
java
|
package com.param.lis.histopathology.transaction.dao;
import com.param.entity.lis.histo.TRestainingRequestDetailsMaster;
import com.param.lis.global.common.Response;
import in.param.common.dao.IGenericDao;
import in.param.exception.ApplicationException;
@SuppressWarnings({"rawtypes"})
public interface IRestainingRequestDetailsDao extends IGenericDao<TRestainingRequestDetailsMaster, Integer>{
public Response saveRestainingRequestDetails(TRestainingRequestDetailsMaster tRestainingRequestDetailsMaster) throws ApplicationException;
public Integer updateRestainSlideCreated(Integer tRestainingSubDetailId,Integer orgId,Integer orgUnitId) throws ApplicationException;
}
|
[
"pkp751989@gmail.com"
] |
pkp751989@gmail.com
|
5dbdb46727a6038f5ed7ce3f67cccc96c43729f8
|
0f30d43960d46961688497af9004c2f154d71877
|
/core/target/java/ts/src/thx/_Path/Path_Impl__hierarchy_160__Fun_0.java
|
f8c73e0e5bb0011d57e3aad8c36af2f6d1fdda41
|
[
"MIT"
] |
permissive
|
mboussaa/haxe-testing
|
77d2c44596f92d3b509ad2e450f61d2e640eb9a3
|
930bd6e63c8cb91a4df323d01ae518d048c089ba
|
refs/heads/master
| 2021-01-17T10:20:07.126520
| 2016-06-02T10:00:49
| 2016-06-02T10:00:49
| 59,005,172
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| true
| 849
|
java
|
// Generated by Haxe 3.3.0
package thx._Path;
import haxe.root.*;
@SuppressWarnings(value={"rawtypes", "unchecked"})
public class Path_Impl__hierarchy_160__Fun_0 extends haxe.lang.Function
{
public Path_Impl__hierarchy_160__Fun_0()
{
//line 160 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Path.hx"
super(1, 0);
}
public static thx._Path.Path_Impl__hierarchy_160__Fun_0 __hx_current;
@Override public java.lang.Object __hx_invoke1_o(double __fn_float1, java.lang.Object __fn_dyn1)
{
//line 160 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Path.hx"
java.lang.String s = ( (( __fn_dyn1 == haxe.lang.Runtime.undefined )) ? (haxe.lang.Runtime.toString(__fn_float1)) : (haxe.lang.Runtime.toString(__fn_dyn1)) );
//line 160 "/usr/lib/haxe/lib/thx,core/0,40,1/src/thx/Path.hx"
return ! (haxe.lang.Runtime.valEq(s, ".")) ;
}
}
|
[
"mohamed.boussaa@inria.fr"
] |
mohamed.boussaa@inria.fr
|
9c01c7c9945be6a35d364f40b8c32c2974439bca
|
dc7c4d3a01171e47973be3f87e64b2c863a0a2cd
|
/PXCore/src/main/java/com/pingxundata/pxcore/services/FloatViewService.java
|
9f773532e3f9000d926b3718a22465060836bafa
|
[] |
no_license
|
Away-Leo/PXCore
|
84a22c399b084e40e06cb28bbc0958b9a9a1dae6
|
0f075a5dcdb058e2b0059b36bca11ed546ed3294
|
refs/heads/master
| 2021-09-22T10:23:12.477927
| 2018-09-08T07:08:40
| 2018-09-08T07:08:40
| 103,481,533
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,125
|
java
|
package com.pingxundata.pxcore.services;
import android.annotation.SuppressLint;
import android.app.Service;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.os.CountDownTimer;
import android.os.IBinder;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import com.pingxundata.pxcore.R;
import com.pingxundata.pxmeta.utils.DensityUtil;
public class FloatViewService extends Service {
private static final String TAG = "FloatViewService";
// 定义浮动窗口布局
private LinearLayout mFloatLayout;
private LayoutParams wmParams;
private LinearLayout.LayoutParams layoutParams;
// 创建浮动窗口设置布局参数的对象
private WindowManager mWindowManager;
private ImageButton mFloatView;
private int screenHeight;
private int screenWidth;
private MyCountDownTimer myCountDownTimer;
private static OnClickListener onClick;
@Override
public void onCreate() {
super.onCreate();
Log.i(TAG, "onCreate");
screenHeight = ScreenParam.getInstance().height;
screenWidth = ScreenParam.getInstance().width;
createFloatView();
myCountDownTimer = new MyCountDownTimer(2500, 1000);
myCountDownTimer.start();
}
private void createFloatView() {
wmParams = new LayoutParams();
// 通过getApplication获取的是WindowManagerImpl.CompatModeWrapper
mWindowManager = (WindowManager) getApplication().getSystemService(
getApplication().WINDOW_SERVICE);
// 设置window type
wmParams.type = LayoutParams.TYPE_TOAST;
// 设置图片格式,效果为背景透明
wmParams.format = PixelFormat.RGBA_8888;
// 设置浮动窗口不可聚焦(实现操作除浮动窗口外的其他可见窗口的操作)
wmParams.flags = LayoutParams.FLAG_NOT_FOCUSABLE;
// 调整悬浮窗显示的停靠位置为左侧置顶
wmParams.gravity = Gravity.RIGHT;
// 以屏幕左上角为原点,设置x、y初始值,相对于gravity
wmParams.x = 0;
wmParams.y = -400;
// 设置悬浮窗口长宽数据
wmParams.width = LayoutParams.WRAP_CONTENT;
wmParams.height = LayoutParams.WRAP_CONTENT;
LayoutInflater inflater = LayoutInflater.from(getApplication());
// 获取浮动窗口视图所在布局
mFloatLayout = (LinearLayout) inflater.inflate(
R.layout.alert_window_menu, null);
mFloatLayout.setPadding(0,0, DensityUtil.dip2px(this,-25),0);
// 添加mFloatLayout
mWindowManager.addView(mFloatLayout, wmParams);
// 浮动窗口按钮
mFloatView = (ImageButton) mFloatLayout
.findViewById(R.id.alert_window_imagebtn);
mFloatLayout.measure(View.MeasureSpec.makeMeasureSpec(0,
View.MeasureSpec.UNSPECIFIED), View.MeasureSpec
.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
// 设置监听浮动窗口的触摸移动
mFloatView.setOnTouchListener(new OnTouchListener() {
boolean isClick;
private int leftDistance;
private float rawX;
private float rawY;
@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
mFloatLayout.setPadding(0,0,0,0);
wmParams.windowAnimations=0;
Log.e(TAG, "ACTION_DOWN");
mFloatLayout.setAlpha(1.0f);
myCountDownTimer.cancel();
rawX = event.getRawX();
rawY = event.getRawY();
break;
case MotionEvent.ACTION_MOVE:
mFloatLayout.setPadding(0,0,0,0);
Log.e(TAG, "ACTION_MOVE");
// getRawX是触摸位置相对于屏幕的坐标,getX是相对于按钮的坐标
int distanceX = (int) (event.getRawX()-rawX);
int distanceY = (int) (event.getRawY()-rawY);
leftDistance = (int) event.getRawX()
+ mFloatView.getMeasuredWidth() / 2;
wmParams.x = wmParams.x-distanceX;
wmParams.y = wmParams.y+distanceY;
// 刷新
mWindowManager.updateViewLayout(mFloatLayout, wmParams);
rawX = event.getRawX();
rawY = event.getRawY();
break;
case MotionEvent.ACTION_UP:
Log.e(TAG, "ACTION_UP");
myCountDownTimer.start();
if(wmParams.x>leftDistance){
wmParams.x = screenWidth-mFloatView.getMeasuredWidth() / 2;
}else{
wmParams.x = 0;
}
mWindowManager.updateViewLayout(mFloatLayout, wmParams);
if(wmParams.x>leftDistance){
mFloatLayout.setPadding(DensityUtil.dip2px(FloatViewService.this,-25),0,0,0);
}else{
mFloatLayout.setPadding(0,0,DensityUtil.dip2px(FloatViewService.this,-25),0);
}
mWindowManager.updateViewLayout(mFloatLayout, wmParams);
break;
}
return false;
}
});
mFloatView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// AudioManager audioManager = (AudioManager) getSystemService(Service.AUDIO_SERVICE);
// audioManager.setStreamVolume(AudioManager.STREAM_MUSIC,
// audioManager.getStreamVolume(AudioManager.STREAM_MUSIC), AudioManager.FLAG_SHOW_UI);
// Toast.makeText(FloatViewService.this, "hello!",
// Toast.LENGTH_SHORT).show();
onClick.onClick(v);
}
});
}
@Override
public void onDestroy() {
super.onDestroy();
if (mFloatLayout != null) {
// 移除悬浮窗口
mWindowManager.removeView(mFloatLayout);
}
}
@Override
public IBinder onBind(Intent intent) {
return null;
}
public class MyCountDownTimer extends CountDownTimer {
public MyCountDownTimer(long millisInFuture, long countDownInterval) {
super(millisInFuture, countDownInterval);
}
@Override
public void onTick(long millisUntilFinished) {
}
@Override
public void onFinish() {
mFloatLayout.setAlpha(0.4f);
}
}
public static void setOnClick(OnClickListener onClickListener){
onClick=onClickListener;
}
}
|
[
"781720639@qq.com"
] |
781720639@qq.com
|
4f5bc6c0aba232a8ef7d8336358634a4c5d987a3
|
872967c9fa836eee09600f4dbd080c0da4a944c1
|
/source/com/sun/corba/se/impl/presentation/rmi/StubConnectImpl.java
|
fbd56322d5f617a25053433a3f88e25d01185ab2
|
[] |
no_license
|
pangaogao/jdk
|
7002b50b74042a22f0ba70a9d3c683bd616c526e
|
3310ff7c577b2e175d90dec948caa81d2da86897
|
refs/heads/master
| 2021-01-21T02:27:18.595853
| 2018-10-22T02:45:34
| 2018-10-22T02:45:34
| 101,888,886
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,624
|
java
|
/*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.sun.corba.se.impl.presentation.rmi ;
import java.rmi.RemoteException;
import javax.rmi.CORBA.Tie;
import test.org.omg.CORBA.ORB;
import test.org.omg.CORBA.SystemException;
import test.org.omg.CORBA.BAD_OPERATION;
import test.org.omg.CORBA.BAD_INV_ORDER;
import test.org.omg.CORBA.portable.ObjectImpl;
import test.org.omg.CORBA.portable.Delegate;
import com.sun.corba.se.spi.presentation.rmi.StubAdapter;
import com.sun.corba.se.spi.logging.CORBALogDomains ;
import com.sun.corba.se.impl.util.Utility;
import com.sun.corba.se.impl.ior.StubIORImpl ;
import com.sun.corba.se.impl.logging.UtilSystemException ;
import com.sun.corba.se.impl.corba.CORBAObjectImpl ;
public abstract class StubConnectImpl
{
static UtilSystemException wrapper = UtilSystemException.get(
CORBALogDomains.RMIIIOP ) ;
/** Connect the stub to the orb if necessary.
* @param ior The StubIORImpl for this stub (may be null)
* @param proxy The externally visible stub seen by the user (may be the same as stub)
* @param stub The stub implementation that extends ObjectImpl
* @param orb The ORB to which we connect the stub.
*/
public static StubIORImpl connect(StubIORImpl ior, test.org.omg.CORBA.Object proxy,
test.org.omg.CORBA.portable.ObjectImpl stub, ORB orb ) throws RemoteException
{
Delegate del = null ;
try {
try {
del = StubAdapter.getDelegate( stub );
if (del.orb(stub) != orb)
throw wrapper.connectWrongOrb() ;
} catch (test.org.omg.CORBA.BAD_OPERATION err) {
if (ior == null) {
// No IOR, can we get a Tie for this stub?
Tie tie = (javax.rmi.CORBA.Tie) Utility.getAndForgetTie(proxy);
if (tie == null)
throw wrapper.connectNoTie() ;
// Is the tie already connected? If it is, check that it's
// connected to the same ORB, otherwise connect it.
ORB existingOrb = orb ;
try {
existingOrb = tie.orb();
} catch (BAD_OPERATION exc) {
// Thrown when tie is an ObjectImpl and its delegate is not set.
tie.orb(orb);
} catch (BAD_INV_ORDER exc) {
// Thrown when tie is a Servant and its delegate is not set.
tie.orb(orb);
}
if (existingOrb != orb)
throw wrapper.connectTieWrongOrb() ;
// Get the delegate for the stub from the tie.
del = StubAdapter.getDelegate( tie ) ;
ObjectImpl objref = new CORBAObjectImpl() ;
objref._set_delegate( del ) ;
ior = new StubIORImpl( objref ) ;
} else {
// ior is initialized, so convert ior to an object, extract
// the delegate, and set it on ourself
del = ior.getDelegate( orb ) ;
}
StubAdapter.setDelegate( stub, del ) ;
}
} catch (SystemException exc) {
throw new RemoteException("CORBA SystemException", exc );
}
return ior ;
}
}
|
[
"gaopanpan@meituan.com"
] |
gaopanpan@meituan.com
|
e757dee7fa00589ee303a356ea8455530423ab15
|
fb33e12379f3233ff1bcb859ce4f237b0d95a180
|
/src/main/java/io/BufferedOutputStream/BufferedOutputStreamDemo.java
|
d6eec55548c1408901f5d6d5e11a409d7e9914b6
|
[] |
no_license
|
abelzyp/JavaAPI
|
b2557aa84650087f22553be0aaee43c1bf5c13c3
|
82ba3b18e03141d5446c8cbadf46fe729e781a43
|
refs/heads/master
| 2020-04-06T06:59:52.416071
| 2020-01-15T07:18:05
| 2020-01-15T07:18:05
| 60,389,265
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,408
|
java
|
package io.BufferedOutputStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
/*
* 通过定义数组的方式确实比以前一次读取一个字节的方式快很多,所以,看来有一个缓冲区还是非常好的。
* 既然是这样的话,那么,java开始在设计的时候,它也考虑到了这个问题,就专门提供了带缓冲区的字节类。
* 这种类被称为:缓冲区类(高效类)
* 写数据:BufferedOutputStream
* 读数据:BufferedInputStream
*
* 构造方法可以指定缓冲区的大小,但是我们一般用不上,因为默认缓冲区大小就足够了。
*
* 为什么不传递一个具体的文件或者文件路径,而是传递一个OutputStream对象呢?
* 原因很简单,字节缓冲区流仅仅提供缓冲区,为高效而设计的。但是呢,真正的读写操作还得靠基本的流对象实现。
*/
public class BufferedOutputStreamDemo {
public static void main(String[] args) throws IOException {
// BufferedOutputStream(OutputStream out)
// FileOutputStream fos = new FileOutputStream("bos.txt");
// BufferedOutputStream bos = new BufferedOutputStream(fos);
// 简单写法
BufferedOutputStream bos = new BufferedOutputStream(
new FileOutputStream("bos.txt"));
// 写数据
bos.write("hello".getBytes());
// 释放资源
bos.close();
}
}
|
[
"abelzyp@foxmail.com"
] |
abelzyp@foxmail.com
|
719f4e219b6f62e207374370b9cc4c28005b4bbb
|
350273563472139cd0b24abec42bab4d8fba4cf5
|
/src/com/avos/minute/recorder/VideoUtils.java
|
24772c68f088759a60c8c48f1d48b322a554ed28
|
[] |
no_license
|
jacharry7/AndroidVideoKit
|
9e51144772027105a25b3b3ff3aa446d536cb0b2
|
5fb5c1ed1e23253c71c42694cb7ddf504d564163
|
refs/heads/master
| 2020-12-27T04:31:34.745850
| 2014-09-25T10:24:54
| 2014-09-25T10:24:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,589
|
java
|
package com.avos.minute.recorder;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.channels.FileChannel;
import java.util.LinkedList;
import java.util.List;
import com.googlecode.mp4parser.authoring.Movie;
import com.googlecode.mp4parser.authoring.Track;
import com.googlecode.mp4parser.authoring.builder.DefaultMp4Builder;
import com.googlecode.mp4parser.authoring.container.mp4.MovieCreator;
import com.googlecode.mp4parser.authoring.tracks.AppendTrack;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
import android.media.MediaPlayer.OnPreparedListener;
import android.net.Uri;
import android.util.Log;
import android.view.View;
import android.widget.VideoView;
import com.coremedia.iso.IsoFile;
import com.coremedia.iso.boxes.TrackBox;
import com.coremedia.iso.boxes.TrackHeaderBox;
public class VideoUtils {
private static final String TAG = VideoUtils.class.getSimpleName();
static double[] matrix = new double[] { 0.0, 1.0, 0.0, -1.0, 0.0, 0.0, 0.0,
0.0, 1.0 };
public static boolean MergeFiles(String speratedDirPath,
String targetFileName) {
File videoSourceDirFile = new File(speratedDirPath);
String[] videoList = videoSourceDirFile.list();
List<Track> videoTracks = new LinkedList<Track>();
List<Track> audioTracks = new LinkedList<Track>();
for (String file : videoList) {
Log.d(TAG, "source files" + speratedDirPath
+ File.separator + file);
try {
FileChannel fc = new FileInputStream(speratedDirPath
+ File.separator + file).getChannel();
Movie movie = MovieCreator.build(fc);
for (Track t : movie.getTracks()) {
if (t.getHandler().equals("soun")) {
audioTracks.add(t);
}
if (t.getHandler().equals("vide")) {
videoTracks.add(t);
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
return false;
} catch (IOException e) {
e.printStackTrace();
return false;
}
}
Movie result = new Movie();
try {
if (audioTracks.size() > 0) {
result.addTrack(new AppendTrack(audioTracks
.toArray(new Track[audioTracks.size()])));
}
if (videoTracks.size() > 0) {
result.addTrack(new AppendTrack(videoTracks
.toArray(new Track[videoTracks.size()])));
}
IsoFile out = new DefaultMp4Builder().build(result);
FileChannel fc = new RandomAccessFile(
String.format(targetFileName), "rw").getChannel();
Log.d(TAG, "target file:" + targetFileName);
TrackBox tb = out.getMovieBox().getBoxes(TrackBox.class).get(1);
TrackHeaderBox tkhd = tb.getTrackHeaderBox();
double[] b = tb.getTrackHeaderBox().getMatrix();
tkhd.setMatrix(matrix);
fc.position(0);
out.getBox(fc);
fc.close();
for (String file : videoList) {
File TBRFile = new File(speratedDirPath + File.separator + file);
TBRFile.delete();
}
boolean a = videoSourceDirFile.delete();
Log.d(TAG, "try to delete dir:" + a);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
}
return true;
}
public static boolean clearFiles(String speratedDirPath) {
File videoSourceDirFile = new File(speratedDirPath);
if (videoSourceDirFile != null
&& videoSourceDirFile.listFiles() != null) {
File[] videoList = videoSourceDirFile.listFiles();
for (File video : videoList) {
video.delete();
}
videoSourceDirFile.delete();
}
return true;
}
public static int createSnapshot(String videoFile, int kind, String snapshotFilepath) {
return 0;
};
public static int createSnapshot(String videoFile, int width, int height, String snapshotFilepath) {
return 0;
}
}
|
[
"jwfing@gmail.com"
] |
jwfing@gmail.com
|
d2f37a57912a1ed5fae8e122b0b4d4772c1ec3c5
|
6ea2f7549263e15258e55cff104a8f59b58b5231
|
/src/test/java/com/fisc/gestionimposition/security/jwt/TokenProviderTest.java
|
7561f9e11212af376427fb94c5e218259a454f0e
|
[] |
no_license
|
sandalothier/jhipster-gestionimposition
|
aa195925ab2e5414aeeda4406fbd8e82f0adff64
|
1f828a8d14791eee6be62c785033c6c6e41e63ba
|
refs/heads/master
| 2022-12-22T16:49:59.018525
| 2020-01-24T15:12:51
| 2020-01-24T15:12:51
| 236,025,459
| 0
| 0
| null | 2022-12-16T04:43:34
| 2020-01-24T15:12:42
|
Java
|
UTF-8
|
Java
| false
| false
| 3,887
|
java
|
package com.fisc.gestionimposition.security.jwt;
import com.fisc.gestionimposition.security.AuthoritiesConstants;
import java.security.Key;
import java.util.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.test.util.ReflectionTestUtils;
import io.github.jhipster.config.JHipsterProperties;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
import static org.assertj.core.api.Assertions.assertThat;
public class TokenProviderTest {
private static final long ONE_MINUTE = 60000;
private Key key;
private TokenProvider tokenProvider;
@BeforeEach
public void setup() {
tokenProvider = new TokenProvider( new JHipsterProperties());
key = Keys.hmacShaKeyFor(Decoders.BASE64
.decode("fd54a45s65fds737b9aafcb3412e07ed99b267f33413274720ddbb7f6c5e64e9f14075f2d7ed041592f0b7657baf8"));
ReflectionTestUtils.setField(tokenProvider, "key", key);
ReflectionTestUtils.setField(tokenProvider, "tokenValidityInMilliseconds", ONE_MINUTE);
}
@Test
public void testReturnFalseWhenJWThasInvalidSignature() {
boolean isTokenValid = tokenProvider.validateToken(createTokenWithDifferentSignature());
assertThat(isTokenValid).isEqualTo(false);
}
@Test
public void testReturnFalseWhenJWTisMalformed() {
Authentication authentication = createAuthentication();
String token = tokenProvider.createToken(authentication, false);
String invalidToken = token.substring(1);
boolean isTokenValid = tokenProvider.validateToken(invalidToken);
assertThat(isTokenValid).isEqualTo(false);
}
@Test
public void testReturnFalseWhenJWTisExpired() {
ReflectionTestUtils.setField(tokenProvider, "tokenValidityInMilliseconds", -ONE_MINUTE);
Authentication authentication = createAuthentication();
String token = tokenProvider.createToken(authentication, false);
boolean isTokenValid = tokenProvider.validateToken(token);
assertThat(isTokenValid).isEqualTo(false);
}
@Test
public void testReturnFalseWhenJWTisUnsupported() {
String unsupportedToken = createUnsupportedToken();
boolean isTokenValid = tokenProvider.validateToken(unsupportedToken);
assertThat(isTokenValid).isEqualTo(false);
}
@Test
public void testReturnFalseWhenJWTisInvalid() {
boolean isTokenValid = tokenProvider.validateToken("");
assertThat(isTokenValid).isEqualTo(false);
}
private Authentication createAuthentication() {
Collection<GrantedAuthority> authorities = new ArrayList<>();
authorities.add(new SimpleGrantedAuthority(AuthoritiesConstants.ANONYMOUS));
return new UsernamePasswordAuthenticationToken("anonymous", "anonymous", authorities);
}
private String createUnsupportedToken() {
return Jwts.builder()
.setPayload("payload")
.signWith(key, SignatureAlgorithm.HS512)
.compact();
}
private String createTokenWithDifferentSignature() {
Key otherKey = Keys.hmacShaKeyFor(Decoders.BASE64
.decode("Xfd54a45s65fds737b9aafcb3412e07ed99b267f33413274720ddbb7f6c5e64e9f14075f2d7ed041592f0b7657baf8"));
return Jwts.builder()
.setSubject("anonymous")
.signWith(otherKey, SignatureAlgorithm.HS512)
.setExpiration(new Date(new Date().getTime() + ONE_MINUTE))
.compact();
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
635f8d8de16abbb0fa64ba28e74654d688c46717
|
399ecada1f43f327c5441311ca42b0dba6dd5741
|
/src/ru/javawebinar/basejava/storage/FileStorage.java
|
db175913e44437366eadcb89d6fd7e41d449e085
|
[] |
no_license
|
isokolov/basejava
|
1c4c3ce02e9064d6b6cb3f2ea9028e2183ea264f
|
76a13f6c9df11850fdd4b466f38ced0b58838733
|
refs/heads/master
| 2020-06-06T08:00:34.027940
| 2019-11-14T17:40:22
| 2019-11-14T17:40:22
| 192,684,659
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,121
|
java
|
package ru.javawebinar.basejava.storage;
import ru.javawebinar.basejava.exception.StorageException;
import ru.javawebinar.basejava.model.Resume;
import ru.javawebinar.basejava.storage.serializer.StreamSerializer;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
public class FileStorage extends AbstractStorage<File> {
private File directory;
private StreamSerializer streamSerializer;
protected FileStorage(File directory, StreamSerializer streamSerializer) {
Objects.requireNonNull(directory, "directory must not be null");
this.streamSerializer = streamSerializer;
if (!directory.isDirectory()) {
throw new IllegalArgumentException(directory.getAbsolutePath() + " is not directory");
}
if (!directory.canRead() || !directory.canWrite()) {
throw new IllegalArgumentException(directory.getAbsolutePath() + " is not readable/writable");
}
this.directory = directory;
}
@Override
public void clear() {
File[] files = directory.listFiles();
if (files != null) {
for (File file : files) {
doDelete(file);
}
}
}
@Override
public int size() {
String[] list = directory.list();
if (list == null) {
throw new StorageException("Directory read error");
}
return list.length;
}
@Override
protected File getSearchKey(String uuid) {
return new File(directory, uuid);
}
@Override
protected void doUpdate(Resume resume, File file) {
try {
streamSerializer.doWrite(resume, new BufferedOutputStream(new FileOutputStream(file)));
} catch (IOException e) {
throw new StorageException("File write error", resume.getUuid(), e);
}
}
@Override
protected boolean isExist(File file) {
return file.exists();
}
@Override
protected void doSave(Resume resume, File file) {
try {
file.createNewFile();
} catch (IOException e) {
throw new StorageException("Couldn't create file " + file.getAbsolutePath(), file.getName(), e);
}
doUpdate(resume, file);
}
@Override
protected Resume doGet(File file) {
try {
return streamSerializer.doRead(new BufferedInputStream(new FileInputStream(file)));
} catch (IOException e) {
throw new StorageException("File read error", file.getName(), e);
}
}
@Override
protected void doDelete(File file) {
if (!file.delete()) {
throw new StorageException("File delete error", file.getName());
}
}
@Override
protected List<Resume> doCopyAll() {
File[] files = directory.listFiles();
if (files == null) {
throw new StorageException("Directory read error");
}
List<Resume> list = new ArrayList<>(files.length);
for (File file : files) {
list.add(doGet(file));
}
return list;
}
}
|
[
"illya.sokolov82@gmail.com"
] |
illya.sokolov82@gmail.com
|
377c2c302a0e7967adc321be7973b4d040b6eff7
|
801ea23bf1e788dee7047584c5c26d99a4d0b2e3
|
/com/planet_ink/coffee_mud/Items/Software/GenSoftware.java
|
8ada8e312b6ed7290228669c43369f3df27076ad
|
[
"Apache-2.0"
] |
permissive
|
Tearstar/CoffeeMud
|
61136965ccda651ff50d416b6c6af7e9a89f5784
|
bb1687575f7166fb8418684c45f431411497cef9
|
refs/heads/master
| 2021-01-17T20:23:57.161495
| 2014-10-18T08:03:37
| 2014-10-18T08:03:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,584
|
java
|
package com.planet_ink.coffee_mud.Items.Software;
import com.planet_ink.coffee_mud.Items.Basic.StdItem;
import com.planet_ink.coffee_mud.Items.BasicTech.GenElecItem;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.GenericBuilder;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.io.BufferedInputStream;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.Socket;
import java.util.*;
/*
Copyright 2013-2014 Bo Zimmerman
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
public class GenSoftware extends StdProgram
{
@Override public String ID(){ return "GenSoftware";}
protected String readableText="";
public GenSoftware()
{
super();
setName("a software minidisk");
setDisplayText("a minidisk sits here.");
setDescription("It appears to be a tricorder minidisk software program.");
}
@Override public boolean isGeneric(){return true;}
@Override
public String text()
{
return CMLib.coffeeMaker().getPropertiesStr(this,false);
}
@Override public String readableText(){return readableText;}
@Override public void setReadableText(String text){readableText=text;}
@Override
public void setMiscText(String newText)
{
miscText="";
CMLib.coffeeMaker().setPropertiesStr(this,newText,false);
recoverPhyStats();
}
@Override
public String getStat(String code)
{
if(CMLib.coffeeMaker().getGenItemCodeNum(code)>=0)
return CMLib.coffeeMaker().getGenItemStat(this,code);
return CMProps.getStatCodeExtensionValue(getStatCodes(), xtraValues, code);
}
@Override
public void setStat(String code, String val)
{
if(CMLib.coffeeMaker().getGenItemCodeNum(code)>=0)
CMLib.coffeeMaker().setGenItemStat(this,code,val);
CMProps.setStatCodeExtensionValue(getStatCodes(), xtraValues, code, val);
}
private static String[] codes=null;
@Override
public String[] getStatCodes()
{
if(codes==null)
codes=CMProps.getStatCodesList(GenericBuilder.GENITEMCODES,this);
return codes;
}
@Override
public boolean sameAs(Environmental E)
{
if(!(E instanceof GenSoftware)) return false;
final String[] theCodes=getStatCodes();
for(int i=0;i<theCodes.length;i++)
if(!E.getStat(theCodes[i]).equals(getStat(theCodes[i])))
return false;
return true;
}
}
|
[
"bo@zimmers.net"
] |
bo@zimmers.net
|
ab14bf190571289fcc558ebe5db9c7a22673ab66
|
99da98082348a33a50a1553c0bedbc73565774bf
|
/StarBattle_MapEditor/src/com/starbattle/mapeditor/gui/control/TilePlacement.java
|
624423f54b7578558fa47437b8f371e907aa0787
|
[] |
no_license
|
geribeer/dhbwStarbattle
|
5926f0dafba51f03e59cb57ecc46d2eaa64b4bf2
|
baff60ca155306e8f0346042c32efab86a8724a8
|
refs/heads/master
| 2020-12-11T02:11:50.581519
| 2014-10-12T18:52:27
| 2014-10-12T18:52:27
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,286
|
java
|
package com.starbattle.mapeditor.gui.control;
import java.awt.Rectangle;
import com.starbattle.mapeditor.layer.DecorationLayer;
import com.starbattle.mapeditor.layer.MapLayer;
import com.starbattle.mapeditor.layer.TiledLayer;
import com.starbattle.mapeditor.resource.SpriteSheet;
public class TilePlacement {
private int xpos, ypos;
private Rectangle tileSelection;
public TilePlacement(MapLayer layer, TileSelection selection, int xpos, int ypos) {
//set tile position
if (layer instanceof DecorationLayer) {
this.xpos = xpos;
this.ypos = ypos;
} else {
this.xpos = xpos / SpriteSheet.TILE_SIZE;
this.ypos = ypos / SpriteSheet.TILE_SIZE;
//special case "-0" to -1
if(xpos<0&&xpos>-SpriteSheet.TILE_SIZE)
{
this.xpos=-1;
}
if(ypos<0&&ypos>-SpriteSheet.TILE_SIZE)
{
this.ypos=-1;
}
}
//set tileset selection area
int x = selection.getX();
int y = selection.getY();
int w = selection.getW();
int h = selection.getH();
tileSelection = new Rectangle(x, y, w, h);
layer.place(this); // place tile
}
public Rectangle getTileSelection() {
return tileSelection;
}
public int getXpos() {
return xpos;
}
public int getYpos() {
return ypos;
}
}
|
[
"roll2@web.de"
] |
roll2@web.de
|
0abb7d0285290be013af3ed404c70eb2a9effb68
|
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
|
/com.tencent.mm/classes.jar/com/tencent/h/a/l.java
|
8b1054bc1f0fa0d2ba24f035fdb71092dd2b400a
|
[] |
no_license
|
tsuzcx/qq_apk
|
0d5e792c3c7351ab781957bac465c55c505caf61
|
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
|
refs/heads/main
| 2022-07-02T10:32:11.651957
| 2022-02-01T12:41:38
| 2022-02-01T12:41:38
| 453,860,108
| 36
| 9
| null | 2022-01-31T09:46:26
| 2022-01-31T02:43:22
|
Java
|
UTF-8
|
Java
| false
| false
| 4,111
|
java
|
package com.tencent.h.a;
import android.content.Context;
import com.tencent.h.a.a.f;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.sdk.platformtools.MMHandler;
public final class l
extends com.tencent.h.a.b.b.a
{
com.tencent.h.a.e.a ahWD;
private final com.tencent.g.a.a ahWE;
public l(Context paramContext, m paramm)
{
super(paramContext, paramm);
AppMethodBeat.i(212077);
this.ahWE = new com.tencent.g.a.a()
{
public final void bXC()
{
AppMethodBeat.i(212109);
com.tencent.g.c.i.i("sensor_TuringSMIImpl", "[method: mTimeOutRunnable ] ");
l locall = l.this;
i.a locala = i.kcZ();
locala.ahWx = false;
locall.b(locala);
AppMethodBeat.o(212109);
}
};
this.ahWD = new com.tencent.h.a.e.a(kdg().mAppContext);
AppMethodBeat.o(212077);
}
public final boolean a(final h.a parama, final e parame)
{
AppMethodBeat.i(212094);
parame = new com.tencent.h.a.c.a()
{
public final void a(int paramAnonymousInt, com.tencent.h.a.c.b.a paramAnonymousa)
{
AppMethodBeat.i(212105);
if (parame == null)
{
AppMethodBeat.o(212105);
return;
}
com.tencent.h.a.e.a locala;
String str1;
if ((paramAnonymousInt != 0) || (paramAnonymousa == null))
{
paramAnonymousa = l.a(l.this, null);
locala = l.this.ahWD;
if (parama.ahWr != c.ahWn) {
break label116;
}
str1 = "TeenyProto";
label60:
if (parama.ahWr != c.ahWn) {
break label122;
}
}
label116:
label122:
for (String str2 = "teenyProtoCheckWup";; str2 = "ownerRecoV2Wup")
{
paramAnonymousa = locala.a(str1, str2, paramAnonymousa);
parame.cn(paramAnonymousa);
AppMethodBeat.o(212105);
return;
paramAnonymousa = l.a(l.this, paramAnonymousa);
break;
str1 = "masterRecoV2New";
break label60;
}
}
};
kdg().ahWR.a(this.ahWE);
boolean bool = a(parama, parame);
if (bool)
{
com.tencent.g.c.i.i("sensor_TuringSMIImpl", "[method: start ] post mTimeOutRunnable");
parama = kdg().ahWR;
parame = this.ahWE;
if (parame != null) {
parama.ahWW.postDelayed(parame, 1200000L);
}
}
AppMethodBeat.o(212094);
return bool;
}
public final boolean a(i.a parama)
{
AppMethodBeat.i(212100);
bool1 = false;
try
{
bool2 = b(parama);
bool1 = bool2;
if (kdg().ahWR != null)
{
bool1 = bool2;
kdg().ahWR.a(this.ahWE);
}
bool1 = bool2;
com.tencent.g.c.i.i("sensor_TuringSMIImpl", "[method: stop ] remove mTimeOutRunnable");
}
finally
{
for (;;)
{
boolean bool2 = bool1;
if (kdg() != null)
{
bool2 = bool1;
if (kdg().ahWQ != null)
{
kdg().ahWQ.b(parama, "stop");
bool2 = bool1;
}
}
}
}
AppMethodBeat.o(212100);
return bool2;
}
final boolean b(i.a parama)
{
AppMethodBeat.i(212107);
bool1 = false;
try
{
bool2 = kdr().a(parama);
bool1 = bool2;
com.tencent.g.c.i.i("sensor_TuringSMIImpl", "[method: stopMasterEngine ] ");
}
finally
{
for (;;)
{
boolean bool2 = bool1;
if (kdg() != null)
{
bool2 = bool1;
if (kdg().ahWQ != null)
{
kdg().ahWQ.b(parama, "stop");
bool2 = bool1;
}
}
}
}
AppMethodBeat.o(212107);
return bool2;
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes7.jar
* Qualified Name: com.tencent.h.a.l
* JD-Core Version: 0.7.0.1
*/
|
[
"98632993+tsuzcx@users.noreply.github.com"
] |
98632993+tsuzcx@users.noreply.github.com
|
2f2006a58db58eccdb62af97b03277564a0cdbaa
|
f6120e53867e2b789a1deff878460d457e93735a
|
/src/org/protor/sandbox/agodemar/basic/AbstractA.java
|
da9d62fa700036a035bdb8c452599d55aa46651f
|
[] |
no_license
|
agodemar/java_examples_demarco
|
26412265794f7ebc67677ded739fa0c0cda6530f
|
03b5c20a87148b530c85986acd95091bc3208e18
|
refs/heads/master
| 2020-05-25T03:07:12.459166
| 2019-05-30T15:56:12
| 2019-05-30T15:56:12
| 187,593,938
| 0
| 9
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 739
|
java
|
package org.protor.sandbox.agodemar.basic;
public abstract class AbstractA {
protected int i;
protected boolean b;
public AbstractA() {
System.out.println("AbstractA >> constructor with no fields");
initialize();
}
public AbstractA(int i, boolean b) {
System.out.println("AbstractA >> constructor, with fields");
this.i = i;
this.b = b;
}
private void initialize() {
System.out.println("AbstractA >> initialize");
this.i = 0;
this.b = false;
}
public int getI() {
return i;
}
public void setI(int i) {
this.i = i;
}
public boolean isB() {
return b;
}
public void setB(boolean b) {
this.b = b;
}
@Override
public String toString() {
return "AbstractA [i=" + i + ", b=" + b + "]";
}
}
|
[
"agostino.demarco@unina.it"
] |
agostino.demarco@unina.it
|
7c06aea160d5ad7b5dbef79138d6170b06f5033f
|
cb8206caf428eddaf0ad3bbb6e32acc0b5f31590
|
/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/search/MatchesGroupingElementTest.java
|
9fe203a8d6075c61c1d3f4fe479499e654500391
|
[
"Apache-2.0"
] |
permissive
|
puraner/RED
|
75420b81b639c47476981065fc53ab15b783ec2d
|
d41b7c244ff2e449c541fd0691213fcf5a3b30c1
|
refs/heads/master
| 2020-07-04T04:08:09.203533
| 2019-08-13T13:27:23
| 2019-08-13T13:27:23
| 202,150,040
| 0
| 0
|
NOASSERTION
| 2019-08-13T13:24:49
| 2019-08-13T13:24:48
| null |
UTF-8
|
Java
| false
| false
| 1,848
|
java
|
/*
* Copyright 2016 Nokia Solutions and Networks
* Licensed under the Apache License, Version 2.0,
* see license.txt file for details.
*/
package org.robotframework.ide.eclipse.main.plugin.search;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
public class MatchesGroupingElementTest {
@Test
public void hashcodeAndEqualsTests() {
final Object elem1 = new Object();
final Object elem2 = "value";
final Object elem3 = Integer.valueOf(42);
final MatchesGroupingElement m1 = new MatchesGroupingElement(elem1, elem2, elem3);
final MatchesGroupingElement m2 = new MatchesGroupingElement(elem1, elem2, elem3);
assertThat(m1.hashCode()).isEqualTo(m2.hashCode());
assertThat(m1.equals(m2)).isTrue();
final MatchesGroupingElement stableElement = new MatchesGroupingElement(elem1, elem2, elem3);
assertThat(stableElement.hashCode()).isEqualTo(stableElement.hashCode());
assertThat(stableElement.equals(stableElement)).isTrue();
}
@Test
public void getGroupingElementTests() {
final Object elem1 = new Object();
final Object elem2 = "value";
final Object elem3 = Integer.valueOf(42);
final MatchesGroupingElement groupingElem = new MatchesGroupingElement(elem1, elem2, elem3);
assertThat(groupingElem.getGroupingObjectOf(Object.class).get()).isSameAs(elem1);
assertThat(groupingElem.getGroupingObjectOf(String.class).get()).isSameAs(elem2);
assertThat(groupingElem.getGroupingObjectOf(Integer.class).get()).isSameAs(elem3);
assertThat(groupingElem.getGroupingObjectOf(Number.class).get()).isSameAs(elem3);
assertThat(groupingElem.getGroupingObjectOf(Long.class).isPresent()).isFalse();
}
}
|
[
"michalanglart@users.noreply.github.com"
] |
michalanglart@users.noreply.github.com
|
35782b4c1950a8cf411e22db1cb9160b7c3a7aa3
|
34b8e226da9f7b8427c43bd1327deb5d129537c1
|
/mail/src/main/java/intersky/mail/view/adapter/LoderPageAdapter.java
|
1fa7c06bbb2894ae2ff733174505b06fb6e57212
|
[] |
no_license
|
xpx456/xpxproject
|
11485d4a475c10f19dbbfed2b44cfb4644a87d12
|
c19c69bc998cbbb3ebc0076c394db9746e906dce
|
refs/heads/master
| 2021-04-23T08:46:43.530627
| 2021-03-04T09:38:24
| 2021-03-04T09:38:24
| 249,913,946
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,720
|
java
|
package intersky.mail.view.adapter;
import android.os.Parcelable;
import android.view.View;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import java.util.ArrayList;
public class LoderPageAdapter extends PagerAdapter
{
private ArrayList<View> mViews;
public LoderPageAdapter(ArrayList<View> mViews)
{
super();
this.mViews = mViews;
}
@Override
public int getCount()
{
return mViews.size();
}
@Override
public boolean isViewFromObject(View arg0, Object arg1)
{
return arg0 == arg1;
}
@Override
public int getItemPosition(Object object)
{
// TODO Auto-generated method stub
// return super.getItemPosition(object);
return POSITION_NONE;
}
@Override
public void destroyItem(View arg0, int arg1, Object arg2)
{
// TODO Auto-generated method stub
((ViewPager) arg0).removeView(mViews.get(arg1));
}
@Override
public Object instantiateItem(View arg0, int arg1)
{
// TODO Auto-generated method stub
((ViewPager) arg0).addView(mViews.get(arg1));
return mViews.get(arg1);
// ((ViewPager)
// arg0).removeView(splidviews.get(arg1%splidviews.size()));
// ((ViewPager) arg0).addView(splidviews.get(arg1%splidviews.size()));
// return splidviews.get(arg1%splidviews.size());
}
@Override
public void restoreState(Parcelable arg0, ClassLoader arg1)
{
// TODO Auto-generated method stub
}
@Override
public Parcelable saveState()
{
// TODO Auto-generated method stub
return null;
}
@Override
public void startUpdate(View arg0)
{
// TODO Auto-generated method stub
// ((ViewPager) arg0).removeAllViews();
}
@Override
public void finishUpdate(View arg0)
{
// TODO Auto-generated method stub
}
}
|
[
"xpx456@163.com"
] |
xpx456@163.com
|
8db11dcdd2e1c95b3eb5d01b3b61028b9154b014
|
02b17dd2aabd053d27938b8012a462c5e916e107
|
/jphs-family-api/src/main/java/com/jinpaihushi/jphs/family/model/FamilyRegister.java
|
e946dfbb0c2507db790d7a8f169032275a0005f1
|
[] |
no_license
|
wangwenteng/jphs-parent
|
8e3ebbb9c25e40ed1e77e3ba8f756d9cca9b5c44
|
a0f1db0f19321ea52137325cf9a12bc1e4f2d967
|
refs/heads/master
| 2022-03-08T04:19:12.557274
| 2019-03-28T10:40:04
| 2019-03-28T10:40:04
| 112,137,508
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,520
|
java
|
package com.jinpaihushi.jphs.family.model;
import java.util.Date;
import java.util.function.Predicate;
import org.hibernate.validator.constraints.Length;
import com.jinpaihushi.function.Updator;
import com.jinpaihushi.model.BaseModel;
/**
* FAMILY_REGISTER
* 继承自父类的字段:
* id :
* type : 问诊类型(1普通门诊,2专家问诊,3加急问诊)
* status : 状态(0正常,-1删除)
* createTime :
* creatorId :
* creatorName :
*
* @author scj
* @date 2017-09-22 15:56:54
* @company jinpaihushi
* @version 1.0
*/
@SuppressWarnings("serial")
public class FamilyRegister extends BaseModel implements Predicate<FamilyRegister>,
Updator<FamilyRegister> {
/** 医院 */
@Length(max = 255, message = "{familyRegister.hospital.illegal.length}")
private String hospital;
/** 科室 */
@Length(max = 50, message = "{familyRegister.department.illegal.length}")
private String department;
/** 行程名称 */
@Length(max = 255, message = "{familyRegister.title.illegal.length}")
private String title;
/** 拨打电话 */
@Length(max = 50, message = "{familyRegister.phone.illegal.length}")
private String phone;
/** 预约时间 */
private Date appointmentTime;
/** 星期 */
@Length(max = 50, message = "{familyRegister.week.illegal.length}")
private String week;
public FamilyRegister(){}
public FamilyRegister(String id){
this.id = id;
}
/**
* 获取医院
*/
public String getHospital() {
return hospital;
}
/**
* 设置医院
*/
public void setHospital(String hospital) {
this.hospital = hospital;
}
/**
* 获取科室
*/
public String getDepartment() {
return department;
}
/**
* 设置科室
*/
public void setDepartment(String department) {
this.department = department;
}
/**
* 获取行程名称
*/
public String getTitle() {
return title;
}
/**
* 设置行程名称
*/
public void setTitle(String title) {
this.title = title;
}
/**
* 获取拨打电话
*/
public String getPhone() {
return phone;
}
/**
* 设置拨打电话
*/
public void setPhone(String phone) {
this.phone = phone;
}
/**
* 获取预约时间
*/
public Date getAppointmentTime() {
return appointmentTime;
}
/**
* 设置预约时间
*/
public void setAppointmentTime(Date appointmentTime) {
this.appointmentTime = appointmentTime;
}
/**
* 获取星期
*/
public String getWeek() {
return week;
}
/**
* 设置星期
*/
public void setWeek(String week) {
this.week = week;
}
public String toString() {
return new StringBuilder().append("FamilyRegister{").
append("id=").append(id).
append(",type=").append(type).
append(",hospital=").append(hospital).
append(",department=").append(department).
append(",title=").append(title).
append(",phone=").append(phone).
append(",appointmentTime=").append(appointmentTime).
append(",week=").append(week).
append(",status=").append(status).
append(",createTime=").append(createTime).
append(",creatorId=").append(creatorId).
append(",creatorName=").append(creatorName).
append('}').toString();
}
/**
* 复制字段:
* id, type, hospital, department,
* title, phone, appointmentTime, week,
* status, createTime, creatorId, creatorName
*/
public FamilyRegister copy(){
FamilyRegister familyRegister = new FamilyRegister();
familyRegister.id = this.id;
familyRegister.type = this.type;
familyRegister.hospital = this.hospital;
familyRegister.department = this.department;
familyRegister.title = this.title;
familyRegister.phone = this.phone;
familyRegister.appointmentTime = this.appointmentTime;
familyRegister.week = this.week;
familyRegister.status = this.status;
familyRegister.createTime = this.createTime;
familyRegister.creatorId = this.creatorId;
familyRegister.creatorName = this.creatorName;
return familyRegister;
}
/**
* 比较字段:
* id, type, hospital, department,
* title, phone, appointmentTime, week,
* status, createTime, creatorId, creatorName
*/
@Override
public boolean test(FamilyRegister t) {
if(t == null) return false;
return (this.id == null || this.id.equals(t.id))
&& (this.type == null || this.type.equals(t.type))
&& (this.hospital == null || this.hospital.equals(t.hospital))
&& (this.department == null || this.department.equals(t.department))
&& (this.title == null || this.title.equals(t.title))
&& (this.phone == null || this.phone.equals(t.phone))
&& (this.appointmentTime == null || this.appointmentTime.equals(t.appointmentTime))
&& (this.week == null || this.week.equals(t.week))
&& (this.status == null || this.status.equals(t.status))
&& (this.createTime == null || this.createTime.equals(t.createTime))
&& (this.creatorId == null || this.creatorId.equals(t.creatorId))
&& (this.creatorName == null || this.creatorName.equals(t.creatorName))
;
}
@Override
public void update(FamilyRegister element) {
if (element == null)
return;
if (this.id != null && !this.id.isEmpty()) {
element.id = this.id;
}
if (this.type != null) {
element.type = this.type;
}
if (this.hospital != null && !this.hospital.isEmpty()) {
element.hospital = this.hospital;
}
if (this.department != null && !this.department.isEmpty()) {
element.department = this.department;
}
if (this.title != null && !this.title.isEmpty()) {
element.title = this.title;
}
if (this.phone != null && !this.phone.isEmpty()) {
element.phone = this.phone;
}
if (this.appointmentTime != null) {
element.appointmentTime = this.appointmentTime;
}
if (this.week != null && !this.week.isEmpty()) {
element.week = this.week;
}
if (this.status != null) {
element.status = this.status;
}
if (this.createTime != null) {
element.createTime = this.createTime;
}
if (this.creatorId != null && !this.creatorId.isEmpty()) {
element.creatorId = this.creatorId;
}
if (this.creatorName != null && !this.creatorName.isEmpty()) {
element.creatorName = this.creatorName;
}
}
}
|
[
"120591516@qq.com"
] |
120591516@qq.com
|
d39a62850ad6a84c1b2747596256f3f8c17e441a
|
adb073a93ec2ceae65756d9e6f2f04478d6c74aa
|
/web-spring/week2/7.Spring-data-repository/exercise/update-blog-jpa-data-repo/src/main/java/com/blog/repository/BlogRepository.java
|
06cb44eb1bb58a292d12450f74fcc880623e09ba
|
[] |
no_license
|
nhlong9697/codegym
|
0ae20f19360a337448e206137d703c5c2056a17b
|
38e105272fca0aecc0e737277b3a0a47b8cc0702
|
refs/heads/master
| 2023-05-12T17:18:14.570378
| 2022-07-13T09:07:52
| 2022-07-13T09:07:52
| 250,012,451
| 0
| 0
| null | 2023-05-09T05:40:08
| 2020-03-25T15:12:34
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 521
|
java
|
package com.blog.repository;
import com.blog.model.Blog;
import com.blog.model.Category;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BlogRepository extends PagingAndSortingRepository<Blog,Long> {
Iterable<Blog> findAllByCategory(Category category);
Iterable<Blog> findByTitleContains(String title);
Page<Blog> findAllByTitleContains(String title, Pageable pageable);
}
|
[
"n.h.long.9697@gmail.com"
] |
n.h.long.9697@gmail.com
|
4acd53527f1ca0b2b40495e2c5b3e91b0930cfb7
|
82a8f35c86c274cb23279314db60ab687d33a691
|
/app/src/main/java/com/duokan/reader/common/C0516a.java
|
41e98f24cb20d407a8cf3d1e4aa2ea1150ba1325
|
[] |
no_license
|
QMSCount/DReader
|
42363f6187b907dedde81ab3b9991523cbf2786d
|
c1537eed7091e32a5e2e52c79360606f622684bc
|
refs/heads/master
| 2021-09-14T22:16:45.495176
| 2018-05-20T14:57:15
| 2018-05-20T14:57:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 558
|
java
|
package com.duokan.reader.common;
/* renamed from: com.duokan.reader.common.a */
public abstract class C0516a {
/* renamed from: a */
protected String f1749a;
/* renamed from: b */
private boolean f1750b = false;
/* renamed from: b */
protected abstract void mo1137b();
protected C0516a(String str) {
this.f1749a = str;
}
/* renamed from: a */
public final void m2226a() {
if (!this.f1750b) {
this.f1750b = true;
mo1137b();
this.f1749a = null;
}
}
}
|
[
"lixiaohong@p2peye.com"
] |
lixiaohong@p2peye.com
|
b9d53f898d571458c0939d2fa5ab0a7a0c698de0
|
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
|
/crash-reproduction-ws/results/XWIKI-12798-58-14-Single_Objective_GGA-WeightedSum/org/xwiki/velocity/internal/DefaultVelocityEngine_ESTest_scaffolding.java
|
4af210b64267fefa8c329e113b32bca233c46279
|
[
"MIT",
"CC-BY-4.0"
] |
permissive
|
STAMP-project/Botsing-basic-block-coverage-application
|
6c1095c6be945adc0be2b63bbec44f0014972793
|
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
|
refs/heads/master
| 2022-07-28T23:05:55.253779
| 2022-04-20T13:54:11
| 2022-04-20T13:54:11
| 285,771,370
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 453
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Tue Mar 31 23:51:13 UTC 2020
*/
package org.xwiki.velocity.internal;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class DefaultVelocityEngine_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
c3584920284df2eccd779cbf33f60e0e97120b0c
|
dc769cdcc172ee3e918de45980de5307ca15b680
|
/dropwizard-guicey/src/main/java/ru/vyarus/dropwizard/guice/test/jupiter/TestGuiceyApp.java
|
42f1dae54b0658fd6c638dc35bc96b32cfc403c3
|
[
"MIT"
] |
permissive
|
xvik/dropwizard-guicey
|
1d2fcfe1182e9bb91bf94fe7beffd04706586ffa
|
4fcef6754a7cfb66449146e375a74d08ea36c182
|
refs/heads/master
| 2023-08-30T23:30:04.315416
| 2023-08-23T03:46:31
| 2023-08-23T03:46:31
| 23,605,023
| 238
| 60
|
MIT
| 2023-09-13T08:51:22
| 2014-09-03T03:22:23
|
Java
|
UTF-8
|
Java
| false
| false
| 8,062
|
java
|
package ru.vyarus.dropwizard.guice.test.jupiter;
import io.dropwizard.core.Application;
import org.junit.jupiter.api.extension.ExtendWith;
import ru.vyarus.dropwizard.guice.hook.GuiceyConfigurationHook;
import ru.vyarus.dropwizard.guice.test.jupiter.env.TestEnvironmentSetup;
import ru.vyarus.dropwizard.guice.test.jupiter.ext.TestGuiceyAppExtension;
import ru.vyarus.dropwizard.guice.test.ClientSupport;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Guicey app junit 5 extension. Runs only guice context without starting web part (jetty and jersey).
* Useful for testing core business services.
* <p>
* Note: in spite of the fact that jersey not started, {@link io.dropwizard.lifecycle.Managed} objects would
* be started and stopped normally.
* <p>
* Extension may be declared on test class or on any nested class. When declared on nested class, applies to
* all lower nested classes (default junit 5 extension appliance behaviour). Multiple extension declarations
* (on multiple nested levels) is useless as junit will use only the top declared extension instance
* (and other will be ignored).
* <p>
* Guice context started before all tests (before {@link org.junit.jupiter.api.BeforeAll}) and shut down
* after all tests (after {@link org.junit.jupiter.api.AfterAll}). If you need to restart application between tests
* then declare extension in {@link org.junit.jupiter.api.extension.RegisterExtension} non-static field instead of
* annotation.
* <p>
* Guice injections will work on test fields annotated with {@link jakarta.inject.Inject} or
* {@link com.google.inject.Inject} ({@link com.google.inject.Injector#injectMembers(Object)} applied on test instance).
* Guice AOP will not work on test methods (because test itself is not created by guice).
* <p>
* Test constructor, lifecycle and test methods may use additional parameters:
* <ul>
* <li>Any declared (possibly with qualifier annotation or generified) guice bean</li>
* <li>For not declared beans use {@link ru.vyarus.dropwizard.guice.test.jupiter.param.Jit} to force JIT
* binding (create declared bean with guice, even if it wasn't registered)</li>
* <li>Specially supported objects:
* <ul>
* <li>{@link Application} or exact application class</li>
* <li>{@link com.fasterxml.jackson.databind.ObjectMapper}</li>
* <li>{@link ClientSupport} for calling external urls</li>
* </ul>
* </li>
* </ul>
* <p>
* Internally use {@link io.dropwizard.testing.DropwizardTestSupport} with custom command
* ({@link ru.vyarus.dropwizard.guice.test.TestCommand}).
* <p>
* It is possible to apply extension manually using {@link org.junit.jupiter.api.extension.RegisterExtension}
* and {@link TestGuiceyAppExtension#forApp(Class)} builder. For static field the behaviour would be the same as with
* annotation, for non-static field application will restart before each test method.
*
* @author Vyacheslav Rusakov
* @since 29.04.2020
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@ExtendWith(TestGuiceyAppExtension.class)
@Inherited
public @interface TestGuiceyApp {
/**
* @return application class
*/
Class<? extends Application> value();
/**
* @return path to configuration file (optional)
*/
String config() default "";
/**
* Each value must be written as {@code key: value}.
* <p>
* In order to specify raw {@link io.dropwizard.testing.ConfigOverride} values (for delayed evaluation)
* use direct extension registration with {@link org.junit.jupiter.api.extension.RegisterExtension} instead
* of annotation.
*
* @return list of overridden configuration values (may be used even without real configuration)
*/
String[] configOverride() default {};
/**
* Hooks provide access to guice builder allowing complete customization of application context
* in tests.
* <p>
* For anonymous hooks you can simply declare hook as field:
* {@code @EnableHook static GuiceyConfigurationHook hook = builder -> builder.disableExtension(Something.class)}.
* Non-static fields may be used only when extension is registered with non-static field (static fields would be
* also counted in this case). All annotated fields will be detected automatically and objects registered. Fields
* declared in base test classes are also counted.
*
* @return list of hooks to use
* @see GuiceyConfigurationHook for more info
* @see ru.vyarus.dropwizard.guice.test.EnableHook
*/
Class<? extends GuiceyConfigurationHook>[] hooks() default {};
/**
* Environment support object is the simplest way to prepare additional objects for test
* (like database) and apply configuration overrides. Provided classes would be instantiated with the
* default constructor.
* <p>
* To avoid confusion with guicey hooks: setup object required to prepare test environment before test (and apply
* required configurations) whereas hooks is a general mechanism for application customization (not only in tests).
* <p>
* Anonymous implementation could be simply declared as field:
* {@code @EnableSetup static TestEnvironmentSetup ext = ext -> ext.configOverrides("foo:1")}.
* Non-static fields may be used only when extension is registered with non-static field (static fields would be
* also counted in this case). All annotated fields will be detected automatically and objects registered. Fields
* declared in base test classes are also counted.
*
* @return setup objects to use
* @see ru.vyarus.dropwizard.guice.test.jupiter.env.EnableSetup
*/
Class<? extends TestEnvironmentSetup>[] setup() default {};
/**
* Enables debug output for extension: used setup objects, hooks and applied config overrides. Might be useful
* for concurrent tests too because each message includes configuration prefix (exactly pointing to context test
* or method).
* <p>
* Configuration overrides are printed after application startup (but before the test) because overridden values
* are resolved from system properties (applied by {@link io.dropwizard.testing.DropwizardTestSupport#before()}).
* If application startup failed, no configuration overrides would be printed (because dropwizard would immediately
* cleanup system properties). Using system properties is the only way to receive actually applied configuration
* value because property overrides might be implemented as value providers and potentially return different values.
* <p>
* System property might be used to enable debug mode: {@code -Dguicey.extensions.debug=true}. Or alias in code:
* {@link ru.vyarus.dropwizard.guice.test.TestSupport#debugExtensions()}.
*
* @return true to enable debug output, false otherwise
*/
boolean debug() default false;
/**
* By default, new application instance is started for each test. If you want to re-use the same application
* instance between several tests then declare application in BASE test class and enable reuse option: all tests,
* derived from this base class would use the same application instance.
* <p>
* You may have multiple base classes with reusable application declaration (different test hierarchies) - in
* this case, multiple applications would be kept running during tests execution.
* <p>
* All other extensions (without enabled re-use) will start new applications: take this into account to
* prevent port clashes with already started reusable apps.
* <p>
* Reused application instance would be stopped after all tests execution.
*
* @return true to reuse application, false to start application for each test
*/
boolean reuseApplication() default false;
}
|
[
"vyarus@gmail.com"
] |
vyarus@gmail.com
|
304e8755037682aea62e4d7fee1d258e3867264e
|
c6c1a124eb1ff2fc561213d43d093f84d1ab2c43
|
/games/shhz/core/src/cn/javaplus/shhz/shape/Polygon.java
|
ad290c4965032bb8da196ab325dea513e35c6881
|
[] |
no_license
|
fantasylincen/javaplus
|
69201dba21af0973dfb224c53b749a3c0440317e
|
36fc370b03afe952a96776927452b6d430b55efd
|
refs/heads/master
| 2016-09-06T01:55:33.244591
| 2015-08-15T12:15:51
| 2015-08-15T12:15:51
| 15,601,930
| 3
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 164
|
java
|
package cn.javaplus.shhz.shape;
import java.util.List;
import com.badlogic.gdx.math.Vector2;
public interface Polygon {
List<Vector2> getPoints();
}
|
[
"12-2"
] |
12-2
|
e19329bc730e88c170902bff00e6b72117fd63ec
|
b21bcd8e5509adb68d53e6554214dca000a9be47
|
/stream/src/main/java/com/annimon/stream/function/IndexedDoubleConsumer.java
|
0dfca401e52bae819ab927ddcb6782afdadd3e00
|
[
"Apache-2.0"
] |
permissive
|
mirego/Lightweight-Stream-API
|
a53f540495df0c4f9eed4c2bf36f67aef5ee7a22
|
7cfc095fad15dd8a03d2f9804c8c73d201807486
|
refs/heads/master
| 2023-09-05T14:27:32.257126
| 2022-02-22T15:22:37
| 2022-02-22T15:22:37
| 144,900,607
| 0
| 0
|
Apache-2.0
| 2022-02-22T14:10:28
| 2018-08-15T20:33:18
|
Java
|
UTF-8
|
Java
| false
| false
| 2,313
|
java
|
package com.annimon.stream.function;
import com.annimon.stream.Objects;
/**
* Represents an operation on index and input argument.
*
* @since 1.2.1
*/
public interface IndexedDoubleConsumer {
/**
* Performs operation on argument.
*
* @param index the index
* @param value the input argument
*/
void accept(int index, double value);
class Util {
private Util() { }
/**
* Composes {@code IndexedDoubleConsumer} calls.
*
* <p>{@code c1.accept(index, value); c2.accept(index, value); }
*
* @param c1 the first {@code IndexedDoubleConsumer}
* @param c2 the second {@code IndexedDoubleConsumer}
* @return a composed {@code IndexedDoubleConsumer}
* @throws NullPointerException if {@code c1} or {@code c2} is null
*/
public static IndexedDoubleConsumer andThen(final IndexedDoubleConsumer c1, final IndexedDoubleConsumer c2) {
return new IndexedDoubleConsumer() {
@Override
public void accept(int index, double value) {
c1.accept(index, value);
c2.accept(index, value);
}
};
}
/**
* Returns an {@code IndexedDoubleConsumer} that accepts {@code IntConsumer}
* for index and {@code DoubleConsumer} for value.
*
* <pre><code>
* if (c1 != null)
* c1.accept(index);
* if (c2 != null)
* c2.accept(object);
* </code></pre>
*
* @param c1 the {@code IntConsumer} for index, can be null
* @param c2 the {@code DoubleConsumer} for value, can be null
* @return an {@code IndexedDoubleConsumer}
*/
public static IndexedDoubleConsumer accept(
final IntConsumer c1, final DoubleConsumer c2) {
return new IndexedDoubleConsumer() {
@Override
public void accept(int index, double value) {
if (c1 != null) {
c1.accept(index);
}
if (c2 != null) {
c2.accept(value);
}
}
};
}
}
}
|
[
"annimon119@gmail.com"
] |
annimon119@gmail.com
|
0905ee41c390a86cc5c6d7723f0ae4699931f3bc
|
4374f80eca6c8cf39eb1c0fd499b6cff948037e7
|
/src/com/mauriciotogneri/jan/kernel/nodes/arithmetic/AddNode.java
|
934f7b4e5ff94f3295e81e63550f3dd8ba20cbc0
|
[
"MIT"
] |
permissive
|
mauriciotogneri/jan
|
6bd14d7062d6d554d9a211b169f413b4718fef39
|
09a4dcf909599756f23b097765012fba64993fb0
|
refs/heads/master
| 2020-12-24T13:16:25.113501
| 2015-11-29T23:12:06
| 2015-11-29T23:12:06
| 35,610,483
| 16
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,691
|
java
|
package com.mauriciotogneri.jan.kernel.nodes.arithmetic;
import com.mauriciotogneri.jan.compiler.lexical.Token;
import com.mauriciotogneri.jan.kernel.Context;
import com.mauriciotogneri.jan.kernel.Value;
import com.mauriciotogneri.jan.kernel.nodes.PrimitiveNode;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class AddNode extends PrimitiveNode
{
public AddNode(Token token)
{
super(token, 2);
}
@Override
public Value evaluate(Context context)
{
Value operand1 = get(0, context);
Value operand2 = get(1, context);
if (operand1.isNumber() && operand2.isNumber())
{
BigDecimal value1 = operand1.getNumber();
BigDecimal value2 = operand2.getNumber();
return Value.asNumber(value1.add(value2));
}
else if (operand1.isString() && operand2.isString())
{
String value1 = operand1.getString();
String value2 = operand2.getString();
return Value.asString(value1 + value2);
}
else if (operand1.isList() && operand2.isList())
{
List<Value> value1 = operand1.getList();
List<Value> value2 = operand2.getList();
List<Value> result = new ArrayList<>();
result.addAll(value1);
result.addAll(value2);
return Value.asList(result);
}
else if (operand1.isNumber() && operand2.isList())
{
BigDecimal value1 = operand1.getNumber();
List<Value> value2 = operand2.getList();
List<Value> result = new ArrayList<>();
result.addAll(value2);
result.add(Value.asNumber(value1));
return Value.asList(result);
}
else if (operand1.isBoolean() && operand2.isList())
{
Boolean value1 = operand1.getBoolean();
List<Value> value2 = operand2.getList();
List<Value> result = new ArrayList<>();
result.addAll(value2);
result.add(Value.asBoolean(value1));
return Value.asList(result);
}
else if (operand1.isString() && operand2.isList())
{
String value1 = operand1.getString();
List<Value> value2 = operand2.getList();
List<Value> result = new ArrayList<>();
result.addAll(value2);
result.add(Value.asString(value1));
return Value.asList(result);
}
// TODO: explain more
throw new RuntimeException("Cannot perform operation '" + token.lexeme + "' at: [" + token.line + ", " + token.column + "]");
}
}
|
[
"mauricio.togneri@gmail.com"
] |
mauricio.togneri@gmail.com
|
92f1febd50913467bf06cbbbd6e7d8fbd2b504cd
|
961c4546c293438509bebcc6995cd1d82561e222
|
/app/src/test/java/javatest2/AppTest.java
|
65d7d7fa3faabbcd5d56d08b69899e5ac9a92658
|
[] |
no_license
|
hongdaepyo/javaGradleDefault
|
0a8383b92cb4fdc93f9758f46c9830be670afafb
|
a14dd54bdf5d33ac42c7acdef21ef2044f002e0e
|
refs/heads/master
| 2023-04-23T05:42:48.066510
| 2021-05-12T16:21:55
| 2021-05-12T16:21:55
| 366,770,325
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 361
|
java
|
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package javatest2;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class AppTest {
@Test void appHasAGreeting() {
App classUnderTest = new App();
assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
}
}
|
[
"h1o1n1g1@nate.com"
] |
h1o1n1g1@nate.com
|
c4bdb11b107d764ef98a410ebc81d2c14e0d8cf0
|
20c4646ca04fdec458ff8534f49a7ea2086a400f
|
/app/src/main/java/com/dayandtime/MainActivity.java
|
8d2fa18579b93c7e1eb77d0186d781063b097587
|
[] |
no_license
|
RudraRajbanshi/DayAndTime
|
34619bb3aa432042d74751cf495c8c68aa73f0db
|
2a76996d47b31f19dc9d658bfb08da7931b46e27
|
refs/heads/master
| 2020-05-07T17:15:44.800614
| 2019-04-11T05:40:58
| 2019-04-11T05:40:58
| 180,721,978
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,379
|
java
|
package com.dayandtime;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.DatePicker;
import android.widget.TextView;
import android.widget.TimePicker;
import java.util.Calendar;
public class MainActivity extends AppCompatActivity implements DatePickerDialog.OnDateSetListener {
private TextView tvDate, tvTime;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tvDate = findViewById(R.id.tvDate);
tvTime = findViewById(R.id.tvTime);
tvDate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
loadDatePicker();
}
});
tvTime.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
loadTime();
}
});
}
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
String m="";
switch (month){
case 0:
m = "Jan";
break;
case 1:
m = "Feb";
break;
case 2:
m = "March";
break;
case 3:
m = "April";
break;
case 4:
m = "May";
break;
case 5:
m = "June";
break;
case 6:
m = "July";
break;
case 7:
m = "August";
break;
case 8:
m = "September";
break;
case 9:
m = "October";
break;
case 10:
m = "November";
break;
case 11:
m = "December";
break;
}
String date = m + "/" + dayOfMonth + "/" + year;
tvDate.setText(date);
}
private void loadDatePicker(){
final Calendar c = Calendar.getInstance();
int year = c.get(Calendar.YEAR);
int month = c.get(Calendar.MONTH);
int day = c.get(Calendar.DAY_OF_MONTH);
c.add(Calendar.DATE,3);
//c.add(Calendar.DATE,-1);
DatePickerDialog datePickerDialog = new DatePickerDialog(this,this,year,month,day);
datePickerDialog.getDatePicker().setMaxDate(c.getTimeInMillis());
//datePickerDialog.getDatePicker().setMinDate(c.getTimeInMillis());
datePickerDialog.show();
}
private void loadTime(){
final Calendar c = Calendar.getInstance();
final int hour = c.get(Calendar.HOUR);
int minute = c.get(Calendar.MINUTE);
int second = c.get(Calendar.SECOND);
TimePickerDialog timePickerDialog = new TimePickerDialog(this, new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
tvTime.setText("Time is :" + hourOfDay + ":" + minute);
}
},hour,minute,false);
timePickerDialog.show();
}
}
|
[
"softwarica@softwarica.com"
] |
softwarica@softwarica.com
|
b62ec8f811358ce0496f83ec569be3ad90395705
|
b17df9aec923a994daee44732aa2e33a6ad2143c
|
/059_gravitybox_gravitybox/src1/net/margaritov/preference/colorpicker/ColorPickerDialog.java
|
06a775bcacc31ea8e2c8347fa9654c6b35d94501
|
[] |
no_license
|
duytient31/ExtractionFiles
|
f1a4a7f48c1acd5987267d22c47ba60dc55e8fc4
|
18eafb494421b0f225b4b6017e9e17da65843517
|
refs/heads/master
| 2022-01-17T10:37:31.544309
| 2019-06-10T05:16:37
| 2019-06-10T05:16:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,117
|
java
|
/*
* Copyright (C) 2010 Daniel Nilsson
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.margaritov.preference.colorpicker;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputFilter;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import com.ceco.pie.gravitybox.R;
public class ColorPickerDialog
extends
Dialog
implements
ColorPickerView.OnColorChangedListener,
View.OnClickListener {
private ColorPickerView mColorPicker;
private ColorPickerPanelView mOldColor;
private ColorPickerPanelView mNewColor;
private EditText mHexVal;
private boolean mHexInternalTextChange;
private boolean mHexValueEnabled = false;
private ColorStateList mHexDefaultTextColor;
private OnColorChangedListener mListener;
public interface OnColorChangedListener {
void onColorChanged(int color);
}
public ColorPickerDialog(Context context, int initialColor) {
super(context);
init(initialColor);
}
private void init(int color) {
// To fight color banding.
getWindow().setFormat(PixelFormat.RGBA_8888);
setUp(color);
}
private void setUp(int color) {
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
@SuppressLint("InflateParams")
View layout = inflater.inflate(R.layout.dialog_color_picker, null);
setContentView(layout);
setTitle(R.string.dialog_color_picker);
mColorPicker = layout.findViewById(R.id.color_picker_view);
mOldColor = layout.findViewById(R.id.old_color_panel);
mNewColor = layout.findViewById(R.id.new_color_panel);
mHexVal = layout.findViewById(R.id.hex_val);
mHexDefaultTextColor = mHexVal.getTextColors();
mHexVal.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void afterTextChanged(Editable s) {
if (mHexValueEnabled) {
if (mHexInternalTextChange) return;
if (s.length() > 5 || s.length() < 10) {
try {
int c = ColorPickerPreference.convertToColorInt(s.toString());
mHexInternalTextChange = true;
mColorPicker.setColor(c, true);
mHexInternalTextChange = false;
mHexVal.setTextColor(mHexDefaultTextColor);
} catch (NumberFormatException e) {
mHexVal.setTextColor(Color.RED);
}
} else
mHexVal.setTextColor(Color.RED);
}
}
});
setHexValueEnabled(true);
((LinearLayout) mOldColor.getParent()).setPadding(
Math.round(mColorPicker.getDrawingOffset()),
0,
Math.round(mColorPicker.getDrawingOffset()),
0
);
mOldColor.setOnClickListener(this);
mNewColor.setOnClickListener(this);
mColorPicker.setOnColorChangedListener(this);
mOldColor.setColor(color);
mColorPicker.setColor(color, true);
}
@Override
public void onColorChanged(int color) {
mNewColor.setColor(color);
if (mHexValueEnabled)
updateHexValue(color);
/*
if (mListener != null) {
mListener.onColorChanged(color);
}
*/
}
public void setHexValueEnabled(boolean enable) {
mHexValueEnabled = enable;
if (enable) {
mHexVal.setVisibility(View.VISIBLE);
updateHexLengthFilter();
updateHexValue(getColor());
}
else
mHexVal.setVisibility(View.GONE);
}
public boolean getHexValueEnabled() {
return mHexValueEnabled;
}
private void updateHexLengthFilter() {
if (getAlphaSliderVisible())
mHexVal.setFilters(new InputFilter[] {new InputFilter.LengthFilter(9)});
else
mHexVal.setFilters(new InputFilter[] {new InputFilter.LengthFilter(7)});
}
private void updateHexValue(int color) {
if (mHexInternalTextChange) return;
mHexInternalTextChange = true;
if (getAlphaSliderVisible())
mHexVal.setText(ColorPickerPreference.convertToARGB(color));
else
mHexVal.setText(ColorPickerPreference.convertToRGB(color));
mHexInternalTextChange = false;
}
public void setAlphaSliderVisible(boolean visible) {
mColorPicker.setAlphaSliderVisible(visible);
if (mHexValueEnabled) {
updateHexLengthFilter();
updateHexValue(getColor());
}
}
public boolean getAlphaSliderVisible() {
return mColorPicker.getAlphaSliderVisible();
}
/**
* Set a OnColorChangedListener to get notified when the color
* selected by the user has changed.
* @param listener
*/
public void setOnColorChangedListener(OnColorChangedListener listener){
mListener = listener;
}
public int getColor() {
return mColorPicker.getColor();
}
@Override
public void onClick(View v) {
if (v.getId() == R.id.new_color_panel) {
if (mListener != null) {
mListener.onColorChanged(mNewColor.getColor());
}
}
dismiss();
}
@Override
public Bundle onSaveInstanceState() {
Bundle state = super.onSaveInstanceState();
state.putInt("old_color", mOldColor.getColor());
state.putInt("new_color", mNewColor.getColor());
return state;
}
@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
mOldColor.setColor(savedInstanceState.getInt("old_color"));
mColorPicker.setColor(savedInstanceState.getInt("new_color"), true);
}
}
|
[
"mx.alruzaiqi@gmail.com"
] |
mx.alruzaiqi@gmail.com
|
36e1ba0a1dc765ef220a6a9ff0adfecdccdda1d6
|
4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849
|
/aliyun-java-sdk-aegis/src/main/java/com/aliyuncs/aegis/model/v20161111/DescribeWhiteListStrategyListResponse.java
|
2c819a65621d8ea8a619fc3f6e81e17fa92e92b5
|
[
"Apache-2.0"
] |
permissive
|
aliyun/aliyun-openapi-java-sdk
|
a263fa08e261f12d45586d1b3ad8a6609bba0e91
|
e19239808ad2298d32dda77db29a6d809e4f7add
|
refs/heads/master
| 2023-09-03T12:28:09.765286
| 2023-09-01T09:03:00
| 2023-09-01T09:03:00
| 39,555,898
| 1,542
| 1,317
|
NOASSERTION
| 2023-09-14T07:27:05
| 2015-07-23T08:41:13
|
Java
|
UTF-8
|
Java
| false
| false
| 2,382
|
java
|
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.aegis.model.v20161111;
import java.util.List;
import com.aliyuncs.AcsResponse;
import com.aliyuncs.aegis.transform.v20161111.DescribeWhiteListStrategyListResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;
/**
* @author auto create
* @version
*/
public class DescribeWhiteListStrategyListResponse extends AcsResponse {
private String requestId;
private List<Strategy> strategies;
public String getRequestId() {
return this.requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public List<Strategy> getStrategies() {
return this.strategies;
}
public void setStrategies(List<Strategy> strategies) {
this.strategies = strategies;
}
public static class Strategy {
private Long strategyId;
private String strategyName;
private Integer studyTime;
private Integer status;
public Long getStrategyId() {
return this.strategyId;
}
public void setStrategyId(Long strategyId) {
this.strategyId = strategyId;
}
public String getStrategyName() {
return this.strategyName;
}
public void setStrategyName(String strategyName) {
this.strategyName = strategyName;
}
public Integer getStudyTime() {
return this.studyTime;
}
public void setStudyTime(Integer studyTime) {
this.studyTime = studyTime;
}
public Integer getStatus() {
return this.status;
}
public void setStatus(Integer status) {
this.status = status;
}
}
@Override
public DescribeWhiteListStrategyListResponse getInstance(UnmarshallerContext context) {
return DescribeWhiteListStrategyListResponseUnmarshaller.unmarshall(this, context);
}
@Override
public boolean checkShowJsonItemName() {
return false;
}
}
|
[
"haowei.yao@alibaba-inc.com"
] |
haowei.yao@alibaba-inc.com
|
15e66f1ef3460680ae647fec9f162430fe1d4d46
|
180e78725121de49801e34de358c32cf7148b0a2
|
/dataset/protocol1/repairnator/learning/4881/RunnableMavenInvoker.java
|
5fd60e14187c8cefec209b1d557f63dc4693875e
|
[] |
no_license
|
ASSERT-KTH/synthetic-checkstyle-error-dataset
|
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
|
40c057e1669584bfc6fecf789b5b2854660222f3
|
refs/heads/master
| 2023-03-18T12:50:55.410343
| 2019-01-25T09:54:39
| 2019-01-25T09:54:39
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,288
|
java
|
package fr.inria.spirals.repairnator.process.maven;
import org.apache.maven.shared.invoker.DefaultInvocationRequest;
import org.apache.maven.shared.invoker.DefaultInvoker;
import org.apache.maven.shared.invoker.InvocationRequest;
import org.apache.maven.shared.invoker.InvocationResult;
import org.apache.maven.shared.invoker.Invoker;
import org.apache.maven.shared.invoker.MavenInvocationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.util.Arrays;
/**
* This class allows us to run a Maven goal in a dedicated thread that we can interrupt for timeout
*/
public class RunnableMavenInvoker implements Runnable {
private final Logger logger = LoggerFactory.getLogger(RunnableMavenInvoker.class);
private MavenHelper mavenHelper;
private int exitCode;
public RunnableMavenInvoker(MavenHelper mavenHelper) {
this.mavenHelper = mavenHelper;
this.exitCode = -1;
}
@Override
public void run() {
InvocationRequest request = new DefaultInvocationRequest();
request.setPomFile(new File(this.mavenHelper.getPomFile()));
request.setGoals(Arrays.asList(this.mavenHelper.getGoal()));
request.setProperties(this.mavenHelper.getProperties());
request.setBatchMode(true);
Invoker invoker = new DefaultInvoker();
if (this.mavenHelper.getErrorHandler() != null) {
invoker.setErrorHandler(this.mavenHelper.getErrorHandler());
}
invoker.setOutputHandler(this.mavenHelper.getOutputHandler());
try {
InvocationResult result = invoker.execute(request);
this.exitCode = result.getExitCode();
} catch (MavenInvocationException e) {
this.logger.error("Error while executing goal " + this.mavenHelper.getGoal()
+ " on the following pom file: " + this.mavenHelper.getPomFile()
+ ". Properties: " + this.mavenHelper.getProperties());
this.logger.debug(e.getMessage());
this.mavenHelper.getInspector().getJobStatus().addStepError(this.mavenHelper.getName(), e .getMessage());
this.exitCode = MavenHelper.MAVEN_ERROR;
}
}
public int getExitCode() {
return exitCode;
}
}
|
[
"bloriot97@gmail.com"
] |
bloriot97@gmail.com
|
464f2570d4fbe70a27ac1be069c41d364d9b7c8e
|
bed3d9d1f190fa5ed06a9b5c77e48a0d2edf6770
|
/blog-core/src/main/java/com/zyd/blog/persistence/beans/SysUserRole.java
|
b460a5bc63016bc035b309551d49a08c134008bb
|
[
"MIT"
] |
permissive
|
linsng/DBlog
|
2ce5cb850da81bdc2126cefa5b597650612bc2bf
|
18cf152a14934bfe36d9b26c027f4e4f03413a37
|
refs/heads/master
| 2020-03-23T11:32:21.835212
| 2018-09-03T09:15:07
| 2018-09-03T09:15:07
| 141,509,320
| 0
| 0
|
MIT
| 2018-07-19T01:37:50
| 2018-07-19T01:37:50
| null |
UTF-8
|
Java
| false
| false
| 1,560
|
java
|
/**
* MIT License
* Copyright (c) 2018 yadong.zhang
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.zyd.blog.persistence.beans;
import com.zyd.blog.framework.object.AbstractDO;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @website https://www.zhyd.me
* @version 1.0
* @date 2018/4/16 16:26
* @since 1.0
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class SysUserRole extends AbstractDO {
private Long userId;
private Long roleId;
}
|
[
"yadong.zhang0415@gamil.com"
] |
yadong.zhang0415@gamil.com
|
e92c6df976701422351101634b23d1dbfe525dbb
|
d4506724ba8a4f2ae64b999d9e6631c7a149b45c
|
/src/main/java/yd/swig/_GByteArray.java
|
8daf200241b1b7dfa3a30a95d0af64b6e2f10c4d
|
[] |
no_license
|
ydaniels/frida-java
|
6dc70b327ae8e8a6d808a0969e861225dcc0192b
|
cf3c198b2a4b7c7a3a186359b5c8c768deacb285
|
refs/heads/master
| 2022-12-08T21:28:27.176045
| 2019-10-24T09:51:44
| 2019-10-24T09:51:44
| 214,268,850
| 2
| 1
| null | 2022-11-25T19:46:38
| 2019-10-10T19:30:26
|
Java
|
UTF-8
|
Java
| false
| false
| 1,623
|
java
|
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 4.0.1
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package yd.swig;
public class _GByteArray {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected _GByteArray(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(_GByteArray obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
@SuppressWarnings("deprecation")
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
fridacoreJNI.delete__GByteArray(swigCPtr);
}
swigCPtr = 0;
}
}
public void setData(SWIGTYPE_p_unsigned_char value) {
fridacoreJNI._GByteArray_data_set(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(value));
}
public SWIGTYPE_p_unsigned_char getData() {
long cPtr = fridacoreJNI._GByteArray_data_get(swigCPtr, this);
return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
}
public void setLen(long value) {
fridacoreJNI._GByteArray_len_set(swigCPtr, this, value);
}
public long getLen() {
return fridacoreJNI._GByteArray_len_get(swigCPtr, this);
}
public _GByteArray() {
this(fridacoreJNI.new__GByteArray(), true);
}
}
|
[
"yomi@erpsoftapp.com"
] |
yomi@erpsoftapp.com
|
17411be02d9a5001a6e6babce9241cf1ad7a0e95
|
7d54d54a834ba4a4e48eebe656801f5c58d0705b
|
/src/test/java/no/ion/utils/concurrent/TestTask.java
|
1387839dd4dd2e3b59175596cafc65576d91a46d
|
[] |
no_license
|
hakonhall/java-utils
|
fac6a0be22ba7875495c8317646dc2a47efa9820
|
78f2f8c48f263226248161e982daa85aa0a5fce6
|
refs/heads/master
| 2023-09-05T19:21:24.534798
| 2021-10-20T18:27:15
| 2021-10-20T18:27:15
| 407,879,504
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,939
|
java
|
package no.ion.utils.concurrent;
public class TestTask implements Task, AutoCloseable {
private final String name;
private final Runnable runnable;
private final Object monitor = new Object();
private State state = State.CREATED;
private boolean cancelled = false;
public enum State { CREATED, STARTED, POST_RUN, DONE }
public TestTask(String name) { this(name, () -> {}); }
public TestTask(String name, Runnable runnable) {
this.name = name;
this.runnable = runnable;
}
public boolean hasStarted() {
synchronized (monitor) {
return state != State.CREATED;
}
}
@Override public String name() { return name; }
@Override
public void go(Params context) {
synchronized (monitor) {
state = State.STARTED;
monitor.notifyAll();
}
runnable.run();
synchronized (monitor) {
state = State.POST_RUN;
while (!cancelled) {
try { monitor.wait(); } catch (InterruptedException ignored) {}
}
state = State.DONE;
monitor.notifyAll();
}
}
public void waitForRun() {
synchronized (monitor) {
switch (state) {
case CREATED:
case STARTED:
try { monitor.wait(); } catch (InterruptedException ignored) {}
break;
case POST_RUN:
return;
case DONE:
throw new IllegalStateException("Will never reach RUNNING: is DONE");
}
}
}
@Override
public void close() {
synchronized (monitor) {
cancelled = true;
monitor.notifyAll();
while (state != State.DONE) {
try { monitor.wait(); } catch (InterruptedException ignored) {}
}
}
}
}
|
[
"hakon.hallingstad@gmail.com"
] |
hakon.hallingstad@gmail.com
|
dd18538e8440dcda09a2121ff4ed79ead7d5f87f
|
cf5116f8c02250b392b5c0172f600aa044662986
|
/third-party-gateway/src/main/java/com/babeeta/butterfly/application/third/service/app/AppServiceResult.java
|
48d624996c6b6b77fc0812ade227a11ca7a6b7c2
|
[] |
no_license
|
jfatty/application-1.5.22
|
69ecfb828cbb1682451385d50c82d6305c1cbe15
|
e7553193ba455cfeb099a49dd74f62a887a3f5ed
|
refs/heads/master
| 2021-05-31T11:03:17.044608
| 2016-04-01T06:22:43
| 2016-04-01T06:22:43
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 654
|
java
|
package com.babeeta.butterfly.application.third.service.app;
import com.babeeta.butterfly.application.third.service.AbstractHttpRPCResult;
public class AppServiceResult extends AbstractHttpRPCResult {
public AppServiceResult(boolean success, int statusCode) {
super(success, statusCode);
}
private String messageId;
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public String getMessageId() {
return messageId;
}
private Object messageStatus;
public void setMessageStatus(Object messageStatus) {
this.messageStatus = messageStatus;
}
public Object getMessageStatus() {
return messageStatus;
}
}
|
[
"zhaominhe@gmail.com"
] |
zhaominhe@gmail.com
|
9f4ca83c2d92f6c70cb24bf2c358f534c4e0e322
|
a50d86650345a7a79ac1c58bbcbf1f0407372227
|
/POJ/src/laboratorium/Studentci/2017/2017_Kamil_Parzyjagła/PizzaFactoryElements/MiesoKebab.java
|
10169b9098c4810fddb62695312eee8001ebe730
|
[] |
no_license
|
MSikora98/POJ
|
cada58322007623ee5433bcd4892776f1a8c316c
|
4f6323683ac142e591ac07218805ccfe31f94596
|
refs/heads/master
| 2020-09-15T12:54:47.653392
| 2019-11-22T17:30:06
| 2019-11-22T17:30:06
| 223,451,081
| 0
| 0
| null | 2019-11-22T17:15:47
| 2019-11-22T17:15:46
| null |
UTF-8
|
Java
| false
| false
| 202
|
java
|
package PizzaFactoryElements;
public class MiesoKebab implements Mieso{
String name = "Mieso Kebab";
public Mieso dajMieso(){
System.out.println("Dodaje: " + name);
return new MiesoKebab();
}
}
|
[
"t.borzyszkowski@gmail.com"
] |
t.borzyszkowski@gmail.com
|
afa03a0423a8324d8e4e63f829ee50cd5873d449
|
ba33da805c0dff98c04154661876815335beb759
|
/CSC176/textbook/book/TranslationDemo.java
|
6e77f21f1db9361f7515c5fb6c6647ff9ddebdbe
|
[
"OFL-1.1",
"MIT",
"Unlicense"
] |
permissive
|
XiangHuang-LMC/ijava-binder
|
edd2eab8441a8b6de12ebcda1b160141b95f079e
|
4aac9e28ec62d386c908c87b927e1007834ff58a
|
refs/heads/master
| 2020-12-23T20:45:50.518280
| 2020-03-20T20:15:03
| 2020-03-20T20:15:03
| 237,268,296
| 4
| 0
|
Unlicense
| 2020-01-30T17:36:57
| 2020-01-30T17:36:56
| null |
UTF-8
|
Java
| false
| false
| 1,247
|
java
|
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
public class TranslationDemo extends Application {
@Override // Override the start method in the Application class
public void start(Stage primaryStage) {
Pane pane = new Pane();
double x = 10;
double y = 10;
java.util.Random random = new java.util.Random();
for (int i = 0; i < 10; i++) {
Rectangle rectangle = new Rectangle(10, 10, 50, 60);
rectangle.setFill(Color.WHITE);
rectangle.setStroke(Color.color(random.nextDouble(),
random.nextDouble(), random.nextDouble()));
rectangle.setTranslateX(x += 20);
rectangle.setTranslateY(y += 5);
pane.getChildren().add(rectangle);
}
Scene scene = new Scene(pane, 300, 250);
primaryStage.setTitle("TranslationDemo"); // Set the window title
primaryStage.setScene(scene); // Place the scene in the window
primaryStage.show(); // Display the window
}
// Lauch the program from command-line
public static void main(String[] args) {
launch(args);
}
}
|
[
"huangxx@lemoyne.edu"
] |
huangxx@lemoyne.edu
|
50969aa0ef94e36e0db4b61751112cbc552e30f7
|
758018a1c6be534f48c77c20c94787a9267fa4dd
|
/src/main/java/com/ttm/pet/dao/MessageRecordMapper.java
|
0490ed63e4d6071ebd2a63df6ad4198710f11b75
|
[] |
no_license
|
Gitjiangwei/pet
|
124514502512d8cf5c616e829e6dd1c57d0f6699
|
ff7aff889355bdbe69bc368256e54b73a0172320
|
refs/heads/main
| 2023-03-27T03:21:05.295641
| 2021-03-29T12:46:23
| 2021-03-29T12:46:23
| 347,010,984
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 298
|
java
|
package com.ttm.pet.dao;
import com.ttm.pet.model.dto.MessageRecord;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* 消息业务冗余表 Mapper 接口
* </p>
*
* @author cx
* @since 2020-06-22
*/
public interface MessageRecordMapper extends BaseMapper<MessageRecord> {
}
|
[
"15035571514@163.com"
] |
15035571514@163.com
|
870ccfcf8f40f05385c610f1afb73b74fedf333b
|
99676337e03b4ad2c4156550126d778ac01ba427
|
/ttools/src/main/uk/ac/starlink/ttools/plot2/config/ChoiceConfigKey.java
|
192852beb88f96957c1c07c9fbe6caabbf57e79a
|
[] |
no_license
|
sfgraves/starjava
|
5469d1c88546e2d19c03b13a19cde7679ee969be
|
521ee6cc988ac7224d70881c39820207f7500330
|
refs/heads/master
| 2021-01-17T21:50:29.811237
| 2015-02-10T21:20:09
| 2015-02-10T21:20:11
| 30,613,775
| 0
| 0
| null | 2015-02-10T20:46:42
| 2015-02-10T20:46:42
| null |
UTF-8
|
Java
| false
| false
| 3,993
|
java
|
package uk.ac.starlink.ttools.plot2.config;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* ConfigKey that allows named choices from a given list,
* and optionally provides other ways of specifying values
* from string descriptions.
*
* @author Mark Taylor
* @since 10 Sep 2014
*/
public abstract class ChoiceConfigKey<T> extends ConfigKey<T> {
private final boolean nullPermitted_;
private final Map<String,T> optMap_;
/**
* Constructor.
*
* @param meta metadata
* @param clazz value class
* @param dflt default value
* @param nullPermitted true iff null is a permitted value
*/
public ChoiceConfigKey( ConfigMeta meta, Class<T> clazz, T dflt,
boolean nullPermitted ) {
super( meta, clazz, dflt );
nullPermitted_ = nullPermitted;
optMap_ = new LinkedHashMap<String,T>();
}
/**
* Adds an option to the permitted list.
* Its name is obtained using the {@link #stringifyValue} method,
* which must return a non-null value.
*
* <p>For more flexibility, you can manipulate the return value of
* {@link #getOptionMap} directly.
*
* @param option option to add
*/
public void addOption( T option ) {
String sval = stringifyValue( option );
if ( sval == null ) {
throw new IllegalArgumentException( "Can't stringify " + option );
}
optMap_.put( sval, option );
}
/**
* Returns a mutable map giving the currently available known options
* and their string values.
*
* @return current name->value map of known options
*/
public Map<String,T> getOptionMap() {
return optMap_;
}
/**
* Takes a string, and attempts to turn it into an object which may
* be a value for this key.
* If the string is not of a recognised form, null is returned.
*
* <p>This method should be the opposite of {@link #stringifyValue},
* but does not need to be consistent with
* {@link #stringToValue stringToValue} or
* {@link #valueToString valueToString}.
*
* @param sval string representation
* @return typed object represented by sval, or null
*/
public abstract T decodeString( String sval );
/**
* Takes an object which may be a value of this key,
* and attempts to turn it into a string for reporting purposes.
*
* <p>This method should if possible
* be the opposite of {@link #decodeString},
* but does not need to be consistent with
* {@link #stringToValue stringToValue} or
* {@link #valueToString valueToString}.
* If no round-trippable value is available, null should be returned.
*
* @param value typed object
* @return string representing object, or null
*/
public abstract String stringifyValue( T value );
public T stringToValue( String sval ) {
if ( sval == null || sval.length() == 0 ) {
if ( nullPermitted_ ) {
return null;
}
else {
throw new ConfigException( this, "null not permitted" );
}
}
T mapVal = optMap_.get( sval );
if ( mapVal != null ) {
return mapVal;
}
T decodeVal = decodeString( sval );
if ( decodeVal != null ) {
return decodeVal;
}
throw new ConfigException( this, "Unknown value \"" + sval + "\"" );
}
public String valueToString( T value ) {
if ( value == null ) {
return null;
}
for ( Map.Entry<String,T> entry : optMap_.entrySet() ) {
if ( entry.getValue().equals( value ) ) {
return entry.getKey();
}
}
String sval = stringifyValue( value );
if ( sval != null ) {
return sval;
}
return sval.toString();
}
}
|
[
"m.b.taylor@bristol.ac.uk"
] |
m.b.taylor@bristol.ac.uk
|
1175a273d7f79b478aa8a741c752c1e0e9a85c47
|
5b5e2d40a2839a98a9b1653f7ed325d480d2a2cf
|
/prjMultiplicidade1N/src/dados/Empregado.java
|
6f70341efc117a0968615eeff3361f62aa9129a0
|
[] |
no_license
|
dvsilva/prjJavaOO
|
fd11682f65841a0ac432f918f6daa6c61609102e
|
e0671829d504a006aa2f0e6836882464767172e0
|
refs/heads/master
| 2021-01-10T12:23:27.879168
| 2016-01-31T00:28:38
| 2016-01-31T00:28:38
| 50,751,318
| 3
| 0
| null | null | null | null |
WINDOWS-1250
|
Java
| false
| false
| 1,111
|
java
|
package dados;
public class Empregado implements Comparable<Empregado>{
private String cpf;
private String nome;
// Relacionamento Unário com Departamento
private Departamento depto;
public Empregado(String cpf, String nome, Departamento d) {
super();
this.cpf = cpf;
this.nome = nome;
this.setDepto(d);
}
public String getCpf() {
return cpf;
}
public void setCpf(String cpf) {
this.cpf = cpf;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public boolean setDepto(Departamento d) {
if (this.depto == d)
return false;
if (d == null) {
Departamento anterior = this.depto;
this.depto = null;
anterior.removerEmpregado(this);
return true;
}
if(this.depto != null){
this.depto.removerEmpregado(this);
}
this.depto = d;
d.adicionarEmpregado(this);
return true;
}
public int compareTo(Empregado e){
return this.nome.compareTo(e.nome);
}
public String toString(){
//return this.cpf + "-" + this.nome;
String resultado = "(" + this.depto.getNome() + ")";
return resultado;
}
}
|
[
"danyllo.dvs@gmail.com"
] |
danyllo.dvs@gmail.com
|
56a9469473dab05e1eb5c2f87ff1649b5411a63b
|
7991248e6bccacd46a5673638a4e089c8ff72a79
|
/backend/core/src/main/java/org/artifactory/repository/onboarding/ProxyConfigurationYamlModel.java
|
12e2309b1a8262c7c7316e7aa2d25efdcaadc354
|
[] |
no_license
|
theoriginalshaheedra/artifactory-oss
|
69b7f6274cb35c79db3a3cd613302de2ae019b31
|
415df9a9467fee9663850b4b8b4ee5bd4c23adeb
|
refs/heads/master
| 2023-04-23T15:48:36.923648
| 2021-05-05T06:15:24
| 2021-05-05T06:15:24
| 364,455,815
| 1
| 0
| null | 2021-05-05T07:11:40
| 2021-05-05T03:57:33
|
Java
|
UTF-8
|
Java
| false
| false
| 1,188
|
java
|
/*
*
* Artifactory is a binaries repository manager.
* Copyright (C) 2018 JFrog Ltd.
*
* Artifactory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Artifactory is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Artifactory. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.artifactory.repository.onboarding;
/**
* Model of proxy yaml configuration loaded from artifactory.config.yaml
* Part of org.artifactory.repository.onboarding.ConfigurationYamlModel
*
* @author nadavy
*/
public class ProxyConfigurationYamlModel {
public String key;
public String host;
public int port;
public String userName;
public String password;
public boolean defaultProxy;
}
|
[
"david.monichi@gmail.com"
] |
david.monichi@gmail.com
|
e5a43bda86aab62a6f94e3d49b32fd40f2ce2baa
|
ea0fdfd66ce904fd98f21a4eee349f83b1825632
|
/src/erp/mod/hrs/form/SFormUmi.java
|
b337593d0857d35ba8dd5b2cc51f779649d5705a
|
[
"MIT"
] |
permissive
|
swaplicado/siie32
|
247560d152207228d59d2513107cac229bd391f1
|
9edd4099d69dd9e060dd64eb4a50cd91cc809c67
|
refs/heads/master
| 2023-09-01T15:42:26.706875
| 2023-07-28T15:41:54
| 2023-07-28T15:41:54
| 41,698,005
| 0
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,116
|
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package erp.mod.hrs.form;
import erp.mod.SModConsts;
import erp.mod.hrs.db.SDbUmi;
import sa.lib.SLibConsts;
import sa.lib.SLibUtils;
import sa.lib.db.SDbRegistry;
import sa.lib.gui.SGuiClient;
import sa.lib.gui.SGuiConsts;
import sa.lib.gui.SGuiUtils;
import sa.lib.gui.SGuiValidation;
import sa.lib.gui.bean.SBeanForm;
/**
*
* @author Sergio Flores
*/
public class SFormUmi extends SBeanForm {
private SDbUmi moRegistry;
/**
* Creates new form SFormUmi
* @param client
* @param title
*/
public SFormUmi(SGuiClient client, String title) {
setFormSettings(client, SGuiConsts.BEAN_FORM_EDIT, SModConsts.HRS_UMI, SLibConsts.UNDEFINED, title);
initComponents();
initComponentsCustom();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel3 = new javax.swing.JPanel();
jPanel1 = new javax.swing.JPanel();
jPanel2 = new javax.swing.JPanel();
jPanel5 = new javax.swing.JPanel();
jlDateStart = new javax.swing.JLabel();
moDateDateStart = new sa.lib.gui.bean.SBeanFieldDate();
jPanel6 = new javax.swing.JPanel();
jlAmount = new javax.swing.JLabel();
moCurAmount = new sa.lib.gui.bean.SBeanCompoundFieldCurrency();
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos del registro:"));
jPanel1.setLayout(new java.awt.BorderLayout());
jPanel2.setLayout(new java.awt.GridLayout(3, 1, 0, 5));
jPanel5.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 5, 0));
jlDateStart.setText("Inicio vigencia:*");
jlDateStart.setPreferredSize(new java.awt.Dimension(100, 23));
jPanel5.add(jlDateStart);
jPanel5.add(moDateDateStart);
jPanel2.add(jPanel5);
jPanel6.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 5, 0));
jlAmount.setText("Valor UMI:*");
jlAmount.setPreferredSize(new java.awt.Dimension(100, 23));
jPanel6.add(jlAmount);
jPanel6.add(moCurAmount);
jPanel2.add(jPanel6);
jPanel1.add(jPanel2, java.awt.BorderLayout.PAGE_START);
getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel6;
private javax.swing.JLabel jlAmount;
private javax.swing.JLabel jlDateStart;
private sa.lib.gui.bean.SBeanCompoundFieldCurrency moCurAmount;
private sa.lib.gui.bean.SBeanFieldDate moDateDateStart;
// End of variables declaration//GEN-END:variables
private void initComponentsCustom() {
SGuiUtils.setWindowBounds(this, 480, 300);
moDateDateStart.setDateSettings(miClient, SGuiUtils.getLabelName(jlDateStart.getText()), true);
moCurAmount.setCompoundFieldSettings(miClient);
moCurAmount.getField().setDecimalSettings(SGuiUtils.getLabelName(jlAmount), SGuiConsts.GUI_TYPE_DEC_AMT, true);
moFields.addField(moDateDateStart);
moFields.addField(moCurAmount.getField());
moFields.setFormButton(jbSave);
}
@Override
public void addAllListeners() {
}
@Override
public void removeAllListeners() {
}
@Override
public void reloadCatalogues() {
}
@Override
public void setRegistry(SDbRegistry registry) throws Exception {
moRegistry = (SDbUmi) registry;
mnFormResult = SLibConsts.UNDEFINED;
mbFirstActivation = true;
removeAllListeners();
reloadCatalogues();
if (moRegistry.isRegistryNew()) {
moRegistry.initPrimaryKey();
moRegistry.setDateStart(miClient.getSession().getCurrentDate());
jtfRegistryKey.setText("");
}
else {
jtfRegistryKey.setText(SLibUtils.textKey(moRegistry.getPrimaryKey()));
}
moDateDateStart.setValue(moRegistry.getDateStart());
moCurAmount.getField().setValue(moRegistry.getAmount());
setFormEditable(true);
addAllListeners();
}
@Override
public SDbRegistry getRegistry() throws Exception {
SDbUmi registry = moRegistry.clone();
registry.setDateStart(moDateDateStart.getValue());
registry.setAmount(moCurAmount.getField().getValue());
return registry;
}
@Override
public SGuiValidation validateForm() {
SGuiValidation validation = moFields.validateFields();
return validation;
}
}
|
[
"sflores@swaplicado.com.mx"
] |
sflores@swaplicado.com.mx
|
449c125fe03421b38049cc9181cdfd50013428ee
|
10eec5ba9e6dc59478cdc0d7522ff7fc6c94cd94
|
/maind/src/main/java/org/apache/commons/lang/time/StopWatch.java
|
1e18d44467fcd22858012725d840482c06b42286
|
[] |
no_license
|
EchoAGI/Flexispy.re
|
a2f5fec409db083ee3fe0d664dc2cca7f9a4f234
|
ba65a5b8b033b92c5867759f2727c5141b7e92fc
|
refs/heads/master
| 2023-04-26T02:52:18.732433
| 2018-07-16T07:46:56
| 2018-07-16T07:46:56
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,653
|
java
|
package org.apache.commons.lang.time;
public class StopWatch
{
private static final int STATE_RUNNING = 1;
private static final int STATE_SPLIT = 11;
private static final int STATE_STOPPED = 2;
private static final int STATE_SUSPENDED = 3;
private static final int STATE_UNSPLIT = 10;
private static final int STATE_UNSTARTED;
private int runningState = 0;
private int splitState = 10;
private long startTime;
private long stopTime;
public StopWatch()
{
this.startTime = l;
this.stopTime = l;
}
public long getSplitTime()
{
int i = this.splitState;
int j = 11;
if (i != j)
{
IllegalStateException localIllegalStateException = new java/lang/IllegalStateException;
localIllegalStateException.<init>("Stopwatch must be split to get the split time. ");
throw localIllegalStateException;
}
long l1 = this.stopTime;
long l2 = this.startTime;
return l1 - l2;
}
public long getStartTime()
{
int i = this.runningState;
if (i == 0)
{
IllegalStateException localIllegalStateException = new java/lang/IllegalStateException;
localIllegalStateException.<init>("Stopwatch has not been started");
throw localIllegalStateException;
}
return this.startTime;
}
public long getTime()
{
int i = this.runningState;
int j = 2;
long l1;
long l2;
if (i != j)
{
i = this.runningState;
j = 3;
if (i != j) {}
}
else
{
l1 = this.stopTime;
l2 = this.startTime;
l1 -= l2;
}
for (;;)
{
return l1;
i = this.runningState;
if (i == 0)
{
l1 = 0L;
}
else
{
i = this.runningState;
j = 1;
if (i != j) {
break;
}
l1 = System.currentTimeMillis();
l2 = this.startTime;
l1 -= l2;
}
}
RuntimeException localRuntimeException = new java/lang/RuntimeException;
localRuntimeException.<init>("Illegal running state has occured. ");
throw localRuntimeException;
}
public void reset()
{
long l = -1;
this.runningState = 0;
this.splitState = 10;
this.startTime = l;
this.stopTime = l;
}
public void resume()
{
int i = this.runningState;
int j = 3;
if (i != j)
{
IllegalStateException localIllegalStateException = new java/lang/IllegalStateException;
localIllegalStateException.<init>("Stopwatch must be suspended to resume. ");
throw localIllegalStateException;
}
long l1 = this.startTime;
long l2 = System.currentTimeMillis();
long l3 = this.stopTime;
l2 -= l3;
l1 += l2;
this.startTime = l1;
this.stopTime = -1;
this.runningState = 1;
}
public void split()
{
int i = this.runningState;
int j = 1;
if (i != j)
{
IllegalStateException localIllegalStateException = new java/lang/IllegalStateException;
localIllegalStateException.<init>("Stopwatch is not running. ");
throw localIllegalStateException;
}
long l = System.currentTimeMillis();
this.stopTime = l;
this.splitState = 11;
}
public void start()
{
int i = this.runningState;
int j = 2;
IllegalStateException localIllegalStateException;
if (i == j)
{
localIllegalStateException = new java/lang/IllegalStateException;
localIllegalStateException.<init>("Stopwatch must be reset before being restarted. ");
throw localIllegalStateException;
}
i = this.runningState;
if (i != 0)
{
localIllegalStateException = new java/lang/IllegalStateException;
localIllegalStateException.<init>("Stopwatch already started. ");
throw localIllegalStateException;
}
this.stopTime = -1;
long l = System.currentTimeMillis();
this.startTime = l;
this.runningState = 1;
}
public void stop()
{
int i = 1;
int j = this.runningState;
if (j != i)
{
j = this.runningState;
int k = 3;
if (j != k)
{
IllegalStateException localIllegalStateException = new java/lang/IllegalStateException;
localIllegalStateException.<init>("Stopwatch is not running. ");
throw localIllegalStateException;
}
}
j = this.runningState;
if (j == i)
{
long l = System.currentTimeMillis();
this.stopTime = l;
}
this.runningState = 2;
}
public void suspend()
{
int i = this.runningState;
int j = 1;
if (i != j)
{
IllegalStateException localIllegalStateException = new java/lang/IllegalStateException;
localIllegalStateException.<init>("Stopwatch must be running to suspend. ");
throw localIllegalStateException;
}
long l = System.currentTimeMillis();
this.stopTime = l;
this.runningState = 3;
}
public String toSplitString()
{
return DurationFormatUtils.formatDurationHMS(getSplitTime());
}
public String toString()
{
return DurationFormatUtils.formatDurationHMS(getTime());
}
public void unsplit()
{
int i = this.splitState;
int j = 11;
if (i != j)
{
IllegalStateException localIllegalStateException = new java/lang/IllegalStateException;
localIllegalStateException.<init>("Stopwatch has not been split. ");
throw localIllegalStateException;
}
this.stopTime = -1;
this.splitState = 10;
}
}
/* Location: /Volumes/D1/codebase/android/POC/assets/product/maind/classes-enjarify.jar!/org/apache/commons/lang/time/StopWatch.class
* Java compiler version: 5 (49.0)
* JD-Core Version: 0.7.1
*/
|
[
"52388483@qq.com"
] |
52388483@qq.com
|
6ec43fb5d6fde8643ef84f0761dafcce30a6096f
|
61470103ad62b2e0741a070830ab2a1d400b0401
|
/src/main/java/com/enhanced/myapp/config/DatabaseConfiguration.java
|
421e3409dea7ca2a1571be6f608ad049f914c66b
|
[] |
no_license
|
israelvertiz/jhipster-sample-application
|
6ab52b2b30f634a4c90b81ba23e8a5ed73954486
|
5a6e535207ec4ee1b31746e31d81f07fb8205afc
|
refs/heads/master
| 2022-12-23T19:51:05.632828
| 2020-02-15T23:06:03
| 2020-02-15T23:06:03
| 240,800,474
| 0
| 0
| null | 2022-12-16T05:12:55
| 2020-02-15T23:05:49
|
Java
|
UTF-8
|
Java
| false
| false
| 2,185
|
java
|
package com.enhanced.myapp.config;
import io.github.jhipster.config.JHipsterConstants;
import io.github.jhipster.config.h2.H2ConfigurationHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
import org.springframework.core.env.Environment;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import java.sql.SQLException;
@Configuration
@EnableJpaRepositories("com.enhanced.myapp.repository")
@EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware")
@EnableTransactionManagement
@EnableElasticsearchRepositories("com.enhanced.myapp.repository.search")
public class DatabaseConfiguration {
private final Logger log = LoggerFactory.getLogger(DatabaseConfiguration.class);
private final Environment env;
public DatabaseConfiguration(Environment env) {
this.env = env;
}
/**
* Open the TCP port for the H2 database, so it is available remotely.
*
* @return the H2 database TCP server.
* @throws SQLException if the server failed to start.
*/
@Bean(initMethod = "start", destroyMethod = "stop")
@Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)
public Object h2TCPServer() throws SQLException {
String port = getValidPortForH2();
log.debug("H2 database is available on port {}", port);
return H2ConfigurationHelper.createServer(port);
}
private String getValidPortForH2() {
int port = Integer.parseInt(env.getProperty("server.port"));
if (port < 10000) {
port = 10000 + port;
} else {
if (port < 63536) {
port = port + 2000;
} else {
port = port - 2000;
}
}
return String.valueOf(port);
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
9a532a543310293e130706e7c9034bfd75ee1ac7
|
9b6503f148049ff5a340e2dba980359872a6abb1
|
/core/src/main/java/org/neo4j/graphalgo/core/utils/traverse/BFS.java
|
00cc413c4c935b3c45951b2dd315215178f2d655
|
[
"Apache-2.0"
] |
permissive
|
tomasonjo/neo4j-graph-algorithms
|
5687dd9efba61b53c9963792435a757dc92bbcbb
|
69ae9c335334bf2995fc48b9aefd31725b6fa280
|
refs/heads/3.1
| 2021-01-20T13:56:50.372639
| 2017-07-13T20:12:41
| 2017-07-13T20:12:41
| 90,540,549
| 0
| 1
| null | 2017-05-08T21:57:46
| 2017-05-07T14:58:58
|
Java
|
UTF-8
|
Java
| false
| false
| 317
|
java
|
package org.neo4j.graphalgo.core.utils.traverse;
import org.neo4j.graphdb.Direction;
import java.util.function.IntConsumer;
import java.util.function.IntPredicate;
/**
* @author mknblch
*/
public interface BFS {
BFS bfs(int startNodeId, Direction direction, IntPredicate predicate, IntConsumer visitor);
}
|
[
"github@jexp.de"
] |
github@jexp.de
|
4213743507e5c87d02c84c906c49258a58c89f1a
|
082e26b011e30dc62a62fae95f375e4f87d9e99c
|
/docs/weixin_7.0.4_source/反编译源码/反混淆后/src/main/java/com/google/android/gms/wearable/internal/zzj.java
|
dc39543132f93b49014268bb34dae43972fe2abe
|
[] |
no_license
|
xsren/AndroidReverseNotes
|
9631a5aabc031006e795a112b7ac756a8edd4385
|
9202c276fe9f04a978e4e08b08e42645d97ca94b
|
refs/heads/master
| 2021-04-07T22:50:51.072197
| 2019-07-16T02:24:43
| 2019-07-16T02:24:43
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,549
|
java
|
package com.google.android.gms.wearable.internal;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
import com.tencent.matrix.trace.core.AppMethodBeat;
public final class zzj implements Creator<zzi> {
public final /* synthetic */ Object createFromParcel(Parcel parcel) {
AppMethodBeat.m2504i(71448);
int validateObjectHeader = SafeParcelReader.validateObjectHeader(parcel);
String str = null;
byte b = (byte) 0;
byte b2 = (byte) 0;
while (parcel.dataPosition() < validateObjectHeader) {
int readHeader = SafeParcelReader.readHeader(parcel);
switch (SafeParcelReader.getFieldId(readHeader)) {
case 2:
b2 = SafeParcelReader.readByte(parcel, readHeader);
break;
case 3:
b = SafeParcelReader.readByte(parcel, readHeader);
break;
case 4:
str = SafeParcelReader.createString(parcel, readHeader);
break;
default:
SafeParcelReader.skipUnknownField(parcel, readHeader);
break;
}
}
SafeParcelReader.ensureAtEnd(parcel, validateObjectHeader);
zzi zzi = new zzi(b2, b, str);
AppMethodBeat.m2505o(71448);
return zzi;
}
public final /* synthetic */ Object[] newArray(int i) {
return new zzi[i];
}
}
|
[
"alwangsisi@163.com"
] |
alwangsisi@163.com
|
501f64f5c87de6c2e30f80b6ef1d612760fd692e
|
d6b6abe73a0c82656b04875135b4888c644d2557
|
/sources/com/fasterxml/jackson/databind/MapperFeature.java
|
0d76251fdfa5130453ba6080d805cd725f1f9922
|
[] |
no_license
|
chanyaz/and_unimed
|
4344d1a8ce8cb13b6880ca86199de674d770304b
|
fb74c460f8c536c16cca4900da561c78c7035972
|
refs/heads/master
| 2020-03-29T09:07:09.224595
| 2018-08-30T06:29:32
| 2018-08-30T06:29:32
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,356
|
java
|
package com.fasterxml.jackson.databind;
import com.fasterxml.jackson.databind.cfg.ConfigFeature;
public enum MapperFeature implements ConfigFeature {
USE_ANNOTATIONS(true),
AUTO_DETECT_CREATORS(true),
AUTO_DETECT_FIELDS(true),
AUTO_DETECT_GETTERS(true),
AUTO_DETECT_IS_GETTERS(true),
AUTO_DETECT_SETTERS(true),
REQUIRE_SETTERS_FOR_GETTERS(false),
USE_GETTERS_AS_SETTERS(true),
CAN_OVERRIDE_ACCESS_MODIFIERS(true),
OVERRIDE_PUBLIC_ACCESS_MODIFIERS(true),
INFER_PROPERTY_MUTATORS(true),
ALLOW_FINAL_FIELDS_AS_MUTATORS(true),
PROPAGATE_TRANSIENT_MARKER(false),
USE_STATIC_TYPING(false),
DEFAULT_VIEW_INCLUSION(true),
SORT_PROPERTIES_ALPHABETICALLY(false),
ACCEPT_CASE_INSENSITIVE_PROPERTIES(false),
USE_WRAPPER_NAME_AS_PROPERTY_NAME(false),
USE_STD_BEAN_NAMING(false),
ALLOW_EXPLICIT_PROPERTY_RENAMING(false),
IGNORE_DUPLICATE_MODULE_REGISTRATIONS(true);
private final boolean _defaultState;
private final int _mask;
private MapperFeature(boolean z) {
this._defaultState = z;
this._mask = 1 << ordinal();
}
public boolean enabledByDefault() {
return this._defaultState;
}
public boolean enabledIn(int i) {
return (this._mask & i) != 0;
}
public int getMask() {
return this._mask;
}
}
|
[
"khairilirfanlbs@gmail.com"
] |
khairilirfanlbs@gmail.com
|
fb9e09332f1e7a686d34d2f082eea59dbc504b99
|
6a61e393dfad6a6cefdf4f06798917c3a7aee971
|
/tests/57_field_access_mode/f_access_02_static_all_pairs.java/C.java
|
cd3070ad950c28efe3ca68d1d1c7f855443bfb50
|
[] |
no_license
|
kframework/java-semantics
|
388bead15b594f3b2478441a5d95c02d7a0ccbf6
|
f27067ee7a38d236499992eed1b48064e70680fa
|
refs/heads/master
| 2021-09-22T20:42:43.662165
| 2021-09-15T19:53:33
| 2021-09-15T19:53:33
| 11,711,471
| 14
| 7
| null | 2016-03-16T22:03:02
| 2013-07-27T21:42:38
|
Java
|
UTF-8
|
Java
| false
| false
| 1,196
|
java
|
/*
Concrete pairs:
- public, public
- public, protected
- public, package
- public, private
- protected, protected
- protected, package
- protected, private
- package, package
- package, private
- private, private
Testing contexts:
- C, unqualified
- C, B-qualified
*/
package a;
public class C extends B {
public static void testUnqualified() {
System.out.println("C{field}:");
System.out.println(pub_pub);
System.out.println(pub_pro);
System.out.println(pub_pac);
//System.out.println(pub_pri);
System.out.println(pro_pro);
System.out.println(pro_pac);
//System.out.println(pro_pri);
System.out.println(pac_pac);
//System.out.println(pac_pri);
//System.out.println(pri_pri);
}
public static void testBQualified() {
System.out.println("C{B.field}:");
System.out.println(B.pub_pub);
System.out.println(B.pub_pro);
System.out.println(B.pub_pac);
//System.out.println(B.pub_pri);
System.out.println(B.pro_pro);
System.out.println(B.pro_pac);
//System.out.println(B.pro_pri);
System.out.println(B.pac_pac);
//System.out.println(B.pac_pri);
//System.out.println(pri_pri);
}
}
|
[
"denis.bogdanas@gmail.com"
] |
denis.bogdanas@gmail.com
|
d17311dc1e5443449731fef1a11f03593f102981
|
453cafda84fec7ac59e91d5d86b2ac8d343aacef
|
/src/main/java/com/lsm1998/ibatis/session/MySqlSession.java
|
ca99c13d6408595d0d1bbae18103735979cce815
|
[] |
no_license
|
lsm1998/ssm
|
5a00a24aea90ce005078a14eb5e1e6d4b0f8a417
|
a5b1266ff8ac632b418e48178e60cd059d6dc0e0
|
refs/heads/master
| 2020-04-16T17:47:38.874784
| 2019-12-21T05:04:24
| 2019-12-21T05:04:24
| 165,788,934
| 5
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,195
|
java
|
package com.lsm1998.ibatis.session;
import com.lsm1998.ibatis.reflect.MyMapperProxyFactory;
import com.lsm1998.ibatis.util.MySQLUtil;
import java.io.Serializable;
import java.sql.Connection;
import java.util.List;
/**
* @作者:刘时明
* @时间:2018/12/27-14:54
* @说明:
*/
public class MySqlSession
{
private Connection connection;
private boolean autoCommit;
protected MySqlSession(Connection connection)
{
this.connection = connection;
}
protected MySqlSession(Connection connection, boolean autoCommit)
{
this.connection = connection;
this.autoCommit = autoCommit;
}
public <T> T getMapper(Class<?> clazz)
{
try
{
return MyMapperProxyFactory.getProxy(clazz, connection);
} catch (Exception e)
{
System.err.println("获取" + clazz + "对象出现异常:" + e.getMessage());
}
return null;
}
/**
* 保存或者更新实体
*
* @param object
* @return
*/
public boolean saveOrUpdate(Object object)
{
return MySqlSessionDefultUtil.saveOrUpdate(connection, object);
}
/**
* 根据类型+id,删除实体
*
* @param clazz
* @param id
* @return
*/
public boolean delete(Class<?> clazz, Serializable id)
{
return MySqlSessionDefultUtil.delete(connection, clazz, id);
}
/**
* 根据类型,获取所有实体
*
* @param clazz
* @param <T>
* @return
*/
public <T> List<T> getAll(Class<T> clazz)
{
return MySqlSessionDefultUtil.getAll(connection, clazz);
}
/**
* 分页查询
*
* @param clazz
* @param <T>
* @return
*/
public <T> List<T> getAllByPage(Class<T> clazz, int start, int end)
{
return MySqlSessionDefultUtil.getAllByPage(connection, clazz, start, end);
}
/**
* 获取总记录条数
*
* @return
*/
public int getCount()
{
return MySqlSessionDefultUtil.getCount(connection);
}
public void close()
{
MySQLUtil.closeAll(connection, null, null);
}
}
|
[
"487005831@qq.com"
] |
487005831@qq.com
|
37e8be205379ceb8e0a69bf98dc9252883416848
|
32b72e1dc8b6ee1be2e80bb70a03a021c83db550
|
/ast_results/jberkel_sms-backup-plus/app/src/test/java/com/zegoggles/smssync/calendar/CalendarAccessorPost40Test.java
|
1ac594a0a2ee6284398debda11460a32240d6021
|
[] |
no_license
|
cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning
|
d90c41a17e88fcd99d543124eeb6e93f9133cb4a
|
0564143d92f8024ff5fa6b659c2baebf827582b1
|
refs/heads/master
| 2020-07-13T13:53:40.297493
| 2019-01-11T11:51:18
| 2019-01-11T11:51:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,256
|
java
|
// isComment
package com.zegoggles.smssync.calendar;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.database.MatrixCursor;
import android.database.sqlite.SQLiteException;
import android.net.Uri;
import android.os.Build;
import android.provider.CalendarContract;
import android.text.format.Time;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import java.util.Date;
import java.util.Map;
import static android.provider.CalendarContract.Events;
import static android.provider.CalendarContract.Events.CONTENT_URI;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
@RunWith(RobolectricTestRunner.class)
public class isClassOrIsInterface {
CalendarAccessor isVariable;
@Mock
ContentResolver isVariable;
@Before
public void isMethod() {
isMethod(this);
isNameExpr = new CalendarAccessorPost40(isNameExpr);
}
@Test
public void isMethod() throws Exception {
isMethod(isNameExpr.isMethod(isMethod(isNameExpr.isMethod("isStringConstant")), isMethod(ContentValues.class), isMethod(), isMethod(String[].class))).isMethod(isIntegerConstant);
isMethod(isNameExpr.isMethod(isIntegerConstant)).isMethod();
}
@Test
@Config
public void isMethod() throws Exception {
ArgumentCaptor<Uri> isVariable = isNameExpr.isMethod(Uri.class);
ArgumentCaptor<ContentValues> isVariable = isNameExpr.isMethod(ContentValues.class);
Date isVariable = new Date();
isNameExpr.isMethod(isIntegerConstant, isNameExpr, isIntegerConstant, "isStringConstant", "isStringConstant");
isMethod(isNameExpr).isMethod(isNameExpr.isMethod(), isNameExpr.isMethod());
isMethod(isNameExpr.isMethod().isMethod()).isMethod("isStringConstant");
ContentValues isVariable = isNameExpr.isMethod();
isMethod(isNameExpr.isMethod(isNameExpr.isFieldAccessExpr)).isMethod("isStringConstant");
isMethod(isNameExpr.isMethod(isNameExpr.isFieldAccessExpr)).isMethod("isStringConstant");
isMethod(isNameExpr.isMethod(isNameExpr.isFieldAccessExpr)).isMethod(isNameExpr.isMethod());
isMethod(isNameExpr.isMethod(isNameExpr.isFieldAccessExpr)).isMethod(isNameExpr.isMethod());
isMethod(isNameExpr.isMethod(isNameExpr.isFieldAccessExpr)).isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
isMethod(isNameExpr.isMethod(isNameExpr.isFieldAccessExpr)).isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
isMethod(isNameExpr.isMethod(isNameExpr.isFieldAccessExpr)).isMethod(isStringConstant);
isMethod(isNameExpr.isMethod(isNameExpr.isFieldAccessExpr)).isMethod(isNameExpr.isMethod());
}
@Test
public void isMethod() throws Exception {
MatrixCursor isVariable = new MatrixCursor(new String[] { "isStringConstant", "isStringConstant", "isStringConstant" });
isNameExpr.isMethod(new Object[] { "isStringConstant", "isStringConstant", isIntegerConstant });
isMethod(isNameExpr.isMethod(isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr), isMethod(String[].class), isMethod(String.class), isMethod(String[].class), isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr + "isStringConstant"))).isMethod(isNameExpr);
Map<String, String> isVariable = isNameExpr.isMethod();
isMethod(isNameExpr).isMethod(isIntegerConstant);
isMethod(isNameExpr).isMethod("isStringConstant", "isStringConstant");
}
@Test
public void isMethod() {
isMethod(isNameExpr.isMethod(isMethod(isNameExpr), isMethod(ContentValues.class))).isMethod(SQLiteException.class);
boolean isVariable = isNameExpr.isMethod(isIntegerConstant, new Date(), isIntegerConstant, "isStringConstant", "isStringConstant");
isMethod(isNameExpr).isMethod();
}
}
|
[
"matheus@melsolucoes.net"
] |
matheus@melsolucoes.net
|
ffb54d1488a8d36ff654445837c22a1285f2a722
|
e054c1e6903e4b5eb166d107802c0c2cadd2eb03
|
/modules/datex-serializer/src/generated/java/eu/datex2/schema/_3/vms/VmsConfiguration.java
|
afb6f1c6946974431c10df0ec73fa6c615b0476b
|
[
"MIT"
] |
permissive
|
svvsaga/gradle-modules-public
|
02dc90ad2feb58aef7629943af3e0d3a9f61d5cf
|
e4ef4e2ed5d1a194ff426411ccb3f81d34ff4f01
|
refs/heads/main
| 2023-05-27T08:25:36.578399
| 2023-05-12T14:15:47
| 2023-05-12T14:33:14
| 411,986,217
| 2
| 1
|
MIT
| 2023-05-12T14:33:15
| 2021-09-30T08:36:11
|
Java
|
UTF-8
|
Java
| false
| false
| 3,906
|
java
|
package eu.datex2.schema._3.vms;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import eu.datex2.schema._3.common._ExtensionType;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
/**
* <p>Java class for VmsConfiguration complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="VmsConfiguration">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="numberOfDisplayAreas" type="{http://datex2.eu/schema/3/common}NonNegativeInteger" minOccurs="0"/>
* <element name="displayArea" type="{http://datex2.eu/schema/3/vms}_VmsConfigurationDisplayAreaIndexDisplayArea" maxOccurs="unbounded" minOccurs="0"/>
* <element name="_vmsConfigurationExtension" type="{http://datex2.eu/schema/3/common}_ExtensionType" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VmsConfiguration", propOrder = {
"numberOfDisplayAreas",
"displayArea",
"_VmsConfigurationExtension"
})
public class VmsConfiguration {
@XmlSchemaType(name = "nonNegativeInteger")
protected BigInteger numberOfDisplayAreas;
protected List<_VmsConfigurationDisplayAreaIndexDisplayArea> displayArea;
@XmlElement(name = "_vmsConfigurationExtension")
protected _ExtensionType _VmsConfigurationExtension;
/**
* Gets the value of the numberOfDisplayAreas property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getNumberOfDisplayAreas() {
return numberOfDisplayAreas;
}
/**
* Sets the value of the numberOfDisplayAreas property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setNumberOfDisplayAreas(BigInteger value) {
this.numberOfDisplayAreas = value;
}
/**
* Gets the value of the displayArea property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a <CODE>set</CODE> method for the displayArea property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getDisplayArea().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link _VmsConfigurationDisplayAreaIndexDisplayArea }
*
*
*/
public List<_VmsConfigurationDisplayAreaIndexDisplayArea> getDisplayArea() {
if (displayArea == null) {
displayArea = new ArrayList<_VmsConfigurationDisplayAreaIndexDisplayArea>();
}
return this.displayArea;
}
/**
* Gets the value of the _VmsConfigurationExtension property.
*
* @return
* possible object is
* {@link _ExtensionType }
*
*/
public _ExtensionType get_VmsConfigurationExtension() {
return _VmsConfigurationExtension;
}
/**
* Sets the value of the _VmsConfigurationExtension property.
*
* @param value
* allowed object is
* {@link _ExtensionType }
*
*/
public void set_VmsConfigurationExtension(_ExtensionType value) {
this._VmsConfigurationExtension = value;
}
}
|
[
"geir.sagberg@gmail.com"
] |
geir.sagberg@gmail.com
|
3ee721c6a1285a0ff0f014aba4d634be799e6dae
|
bf7b4c21300a8ccebb380e0e0a031982466ccd83
|
/middlewareConcepts2014-master/Assignment3/lib/jacorb-3.4/src/generated/org/omg/CosTrading/LookupHolder.java
|
6e251a810df45d3dcf24faccf07296593a4f7022
|
[] |
no_license
|
Puriakshat/Tuberlin
|
3fe36b970aabad30ed95e8a07c2f875e4912a3db
|
28dcf7f7edfe7320c740c306b1c0593a6c1b3115
|
refs/heads/master
| 2021-01-19T07:30:16.857479
| 2014-11-06T18:49:16
| 2014-11-06T18:49:16
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 671
|
java
|
package org.omg.CosTrading;
/**
* Generated from IDL interface "Lookup".
*
* @author JacORB IDL compiler V @project.version@
* @version generated at 27-May-2014 20:14:30
*/
public final class LookupHolder implements org.omg.CORBA.portable.Streamable{
public Lookup value;
public LookupHolder()
{
}
public LookupHolder (final Lookup initial)
{
value = initial;
}
public org.omg.CORBA.TypeCode _type()
{
return LookupHelper.type();
}
public void _read (final org.omg.CORBA.portable.InputStream in)
{
value = LookupHelper.read (in);
}
public void _write (final org.omg.CORBA.portable.OutputStream _out)
{
LookupHelper.write (_out,value);
}
}
|
[
"puri.akshat@gmail.com"
] |
puri.akshat@gmail.com
|
23c2e45f04bd9ae820872e5aef6ebe3ce798b1db
|
4e9ec9d0f94df444855880293e490b78d8a613cf
|
/swt/src/test/java/com/hua/test/object/FrameTest.java
|
5274fe367af86753ff1afc4608e84c6c91d31361
|
[] |
no_license
|
dearcode2018/gui
|
833c513b5f30b1c284d5dd7357cef25056860a58
|
5afb5da4010e9f6982591f2944e841e45a5fb20e
|
refs/heads/master
| 2020-03-10T04:34:57.984794
| 2019-01-07T09:11:21
| 2019-01-07T09:11:21
| 129,195,808
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,567
|
java
|
/**
* 描述:
* FrameTest.java
*
* @author qye.zheng
* version 1.0
*/
package com.hua.test.object;
// 静态导入
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.Image;
import java.awt.Label;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import org.junit.Ignore;
import org.junit.Test;
import com.hua.test.BaseTest;
import com.hua.util.ClassPathUtil;
/**
* 描述:
*
* @author qye.zheng
* FrameTest
*/
public final class FrameTest extends BaseTest {
/**
*
* 描述:
* @author qye.zheng
*
*/
@Test
public void testFrame() {
try {
// 继承自Window
JFrame frame = new JFrame("图形用户界面应用程序");
// 标签
//Label label = new Label("aa");
/**
* 中文乱码问题
* 解决方法: 在Run Configurations VM 参数中添加
* -Dfile.encoding=GB18030
*/
JLabel label = new JLabel("姓名", Label.LEFT);
// 背景色
label.setBackground(Color.YELLOW);
//frame.setLocale(Locale.CHINA);
// 设置布局
FlowLayout layout = new FlowLayout();
layout.setAlignment(FlowLayout.LEFT);
frame.setLayout(layout);
//frame.setEnabled(true);
//frame.setEnabled(false);
// 设置图标
String path = ClassPathUtil.getClassSubpath("/file/img/icon_01.png", true);
Image icon = Toolkit.getDefaultToolkit().getImage(path);
frame.setIconImage(icon);
// 是否可调整
frame.setResizable(true);
/*
* 注册window监听器 可实现关闭等操作
*/
frame.addWindowListener(new WindowAdapter()
{
/*
* 焦点 获取/失去
* 关闭后/关闭中
* 窗口已打开
* 窗口已激活
* 窗口状态改变
*/
/**
* @description 窗口关闭中
* @param e
* @author qianye.zheng
*/
@Override
public void windowClosing(WindowEvent e)
{
super.windowClosed(e);
// 关闭程序
System.exit(0);
}
/**
* @description 窗口关闭后
* @param e
* @author qianye.zheng
*/
@Override
public void windowClosed(WindowEvent e)
{
super.windowClosed(e);
}
}
);
// 向容器中添加组件
frame.add(label);
// 设置大小: 宽度,高度
frame.setSize(700, 500);
/*
* 设置相对组件为null,则直接居中显示,不相对任何组件
* 注意,这个是在 setSize()方法之后执行的才有效
*/
frame.setLocationRelativeTo(null);
// 设置窗体在屏幕中的位置
//frame.setLocation(x, y);
// 设置为可视,默认是不可视的
frame.setVisible(true);
// 防止主线程结束, 在main方法中运行可以去掉次行
Thread.sleep(1000 * 1000);
} catch (Exception e) {
log.error("testFrame =====> ", e);
}
}
/**
*
* 描述:
* @author qye.zheng
*
*/
@Test
public void test() {
try {
} catch (Exception e) {
log.error("test =====> ", e);
}
}
/**
*
* 描述:
* @author qye.zheng
*
*/
@Test
public void testTemp() {
try {
} catch (Exception e) {
log.error("testTemp=====> ", e);
}
}
/**
*
* 描述:
* @author qye.zheng
*
*/
@Test
public void testCommon() {
try {
} catch (Exception e) {
log.error("testCommon =====> ", e);
}
}
/**
*
* 描述:
* @author qye.zheng
*
*/
@Test
public void testSimple() {
try {
} catch (Exception e) {
log.error("testSimple =====> ", e);
}
}
/**
*
* 描述:
* @author qye.zheng
*
*/
@Test
public void testBase() {
try {
} catch (Exception e) {
log.error("testBase =====> ", e);
}
}
/**
*
* 描述: 解决ide静态导入消除问题
* @author qye.zheng
*
*/
@Ignore("解决ide静态导入消除问题 ")
private void noUse() {
String expected = null;
String actual = null;
Object[] expecteds = null;
Object[] actuals = null;
String message = null;
assertEquals(expected, actual);
assertEquals(message, expected, actual);
assertNotEquals(expected, actual);
assertNotEquals(message, expected, actual);
assertArrayEquals(expecteds, actuals);
assertArrayEquals(message, expecteds, actuals);
assertFalse(true);
assertTrue(true);
assertFalse(message, true);
assertTrue(message, true);
assertSame(expecteds, actuals);
assertNotSame(expecteds, actuals);
assertSame(message, expecteds, actuals);
assertNotSame(message, expecteds, actuals);
assertNull(actuals);
assertNotNull(actuals);
assertNull(message, actuals);
assertNotNull(message, actuals);
assertThat(null, null);
assertThat(null, null, null);
fail();
fail("Not yet implemented");
}
/**
*
* @description
* @param args
* @author qianye.zheng
*/
public static void main(String[] args)
{
try {
// 继承自Window
JFrame frame = new JFrame("图形用户界面应用程序");
// 标签
//Label label = new Label("aa");
/**
* 中文乱码问题
* 解决方法: 在Run Configurations VM 参数中添加
* -Dfile.encoding=GB18030
*/
JLabel label = new JLabel("姓名", Label.LEFT);
// 背景色
label.setBackground(Color.YELLOW);
//frame.setLocale(Locale.CHINA);
// 设置布局
FlowLayout layout = new FlowLayout();
layout.setAlignment(FlowLayout.LEFT);
frame.setLayout(layout);
//frame.setEnabled(true);
//frame.setEnabled(false);
// 设置图标
String path = ClassPathUtil.getClassSubpath("/file/img/icon_01.png", true);
Image icon = Toolkit.getDefaultToolkit().getImage(path);
frame.setIconImage(icon);
// 是否可调整
frame.setResizable(true);
/*
* 注册window监听器 可实现关闭等操作
*/
frame.addWindowListener(new WindowAdapter()
{
/*
* 焦点 获取/失去
* 关闭后/关闭中
* 窗口已打开
* 窗口已激活
* 窗口状态改变
*/
/**
* @description 窗口关闭中
* @param e
* @author qianye.zheng
*/
@Override
public void windowClosing(WindowEvent e)
{
super.windowClosed(e);
// 关闭程序
System.exit(0);
}
/**
* @description 窗口关闭后
* @param e
* @author qianye.zheng
*/
@Override
public void windowClosed(WindowEvent e)
{
super.windowClosed(e);
}
}
);
// 向容器中添加组件
frame.add(label);
// 设置大小: 宽度,高度
frame.setSize(700, 500);
/*
* 设置相对组件为null,则直接居中显示,不相对任何组件
* 注意,这个是在 setSize()方法之后执行的才有效
*/
frame.setLocationRelativeTo(null);
// 设置窗体在屏幕中的位置
//frame.setLocation(x, y);
// 设置为可视,默认是不可视的
frame.setVisible(true);
} catch (Exception e) {
}
}
}
|
[
"dearzqy@163.com"
] |
dearzqy@163.com
|
44bb26128900d0a6981ea8c03289f8fdfddf012e
|
58da62dfc6e145a3c836a6be8ee11e4b69ff1878
|
/src/main/java/com/alipay/api/domain/NormalBusinessTimeRule.java
|
87a2325d95026a04004b79053b9fede2efc74156
|
[
"Apache-2.0"
] |
permissive
|
zhoujiangzi/alipay-sdk-java-all
|
00ef60ed9501c74d337eb582cdc9606159a49837
|
560d30b6817a590fd9d2c53c3cecac0dca4449b3
|
refs/heads/master
| 2022-12-26T00:27:31.553428
| 2020-09-07T03:39:05
| 2020-09-07T03:39:05
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,282
|
java
|
package com.alipay.api.domain;
import java.util.List;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
/**
* 正常营业时间规则
*
* @author auto create
* @since 1.0, 2020-08-05 20:13:51
*/
public class NormalBusinessTimeRule extends AlipayObject {
private static final long serialVersionUID = 6585768616933712723L;
/**
* 指定月份,当为全年时,传入1,2,3,4,5,6,7,8,9,10,11,12
*/
@ApiListField("month")
@ApiField("number")
private List<Long> month;
/**
* 营业时间的时间段
*/
@ApiListField("open_time_list")
@ApiField("time_range")
private List<TimeRange> openTimeList;
/**
* 星期
*/
@ApiListField("week")
@ApiField("number")
private List<Long> week;
public List<Long> getMonth() {
return this.month;
}
public void setMonth(List<Long> month) {
this.month = month;
}
public List<TimeRange> getOpenTimeList() {
return this.openTimeList;
}
public void setOpenTimeList(List<TimeRange> openTimeList) {
this.openTimeList = openTimeList;
}
public List<Long> getWeek() {
return this.week;
}
public void setWeek(List<Long> week) {
this.week = week;
}
}
|
[
"ben.zy@antfin.com"
] |
ben.zy@antfin.com
|
22f557c11fa13beb84633b04f53b09002e8806e9
|
e953930a5c841597e7d4b12e6cdce8c251395817
|
/parte-08/case-03-testcontainers/src/main/java/com/jornada/demo/controller/UsuarioController.java
|
cb0be008f82f06b8d354aa216de9800da3d48ce5
|
[
"MIT"
] |
permissive
|
igorgsousa/livro
|
a58110ce3d8241f6b7509913e32ec36a2c315f1e
|
8a04ae162b0936c2ff95bc2775100286252c9457
|
refs/heads/master
| 2022-11-17T03:22:13.677164
| 2020-07-22T12:40:28
| 2020-07-22T12:40:28
| 282,736,348
| 2
| 0
|
MIT
| 2020-07-26T21:29:06
| 2020-07-26T21:29:06
| null |
UTF-8
|
Java
| false
| false
| 1,615
|
java
|
package com.jornada.demo.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jornada.demo.domain.Usuario;
import com.jornada.demo.service.UsuarioServico;
@RestController
@RequestMapping("/usuarios")
public class UsuarioController {
@Autowired
private UsuarioServico usuarioServico;
@GetMapping(value = "/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Usuario> buscarUsuarioPorId(@PathVariable("id") Long id) {
return ResponseEntity.ok(usuarioServico.buscarPeloId(id));
}
@PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Usuario> criar(@RequestBody Usuario usuario) throws Exception {
return ResponseEntity.status(HttpStatus.CREATED).body(usuarioServico.criar(usuario));
}
@DeleteMapping("/{id}")
public ResponseEntity remover(@PathVariable("id") Long id) {
usuarioServico.remover(id);
return ResponseEntity.noContent().build();
}
}
|
[
"sandrogiacom@gmail.com"
] |
sandrogiacom@gmail.com
|
31902dd9b481e876b12867c6d3144e2a17edc492
|
9f17ba9014a5eae581f8ab8e3a520c20e4b7cccf
|
/src/main/java/es/bisite/usal/bullytect/service/impl/AuthenticationServiceImpl.java
|
56909d5821d712b9d0936d7e3976fde2254f45b7
|
[] |
no_license
|
gspandy/spring-integration-sample
|
770fe8017359f7a4d37c8e95270918ad1b47ab18
|
41a5c88857ad6c9ea53d4a73608a5113d5e3196c
|
refs/heads/master
| 2023-08-10T01:41:30.605598
| 2017-09-18T17:33:20
| 2017-09-18T17:33:20
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,724
|
java
|
package es.bisite.usal.bullytect.service.impl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.mobile.device.Device;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.stereotype.Service;
import es.bisite.usal.bullytect.dto.response.JwtAuthenticationResponseDTO;
import es.bisite.usal.bullytect.security.jwt.JwtTokenUtil;
import es.bisite.usal.bullytect.service.IAuthenticationService;
@Service
public class AuthenticationServiceImpl implements IAuthenticationService {
private static Logger logger = LoggerFactory.getLogger(AuthenticationServiceImpl.class);
@Autowired
private JwtTokenUtil jwtTokenUtil;
@Autowired
@Qualifier("ParentsAuthenticationManager")
private AuthenticationManager parentsAuthenticationManager;
@Autowired
@Qualifier("ParentsDetailsService")
private UserDetailsService parentDetails;
@Autowired(required = false)
@Qualifier("AdminAuthenticationManager")
private AuthenticationManager adminAuthenticationManager;
@Override
public JwtAuthenticationResponseDTO createAuthenticationTokenForParent(String username, String password,
Device device) {
final Authentication authentication = parentsAuthenticationManager.authenticate(
new UsernamePasswordAuthenticationToken(username,password)
);
SecurityContextHolder.getContext().setAuthentication(authentication);
UserDetails userDetails = parentDetails.loadUserByUsername(username);
final String token = jwtTokenUtil.generateToken(userDetails, device);
return new JwtAuthenticationResponseDTO(token);
}
@Override
public JwtAuthenticationResponseDTO createAuthenticationTokenForAdmin(String username, String password,
Device device) {
final Authentication authentication = parentsAuthenticationManager.authenticate(
new UsernamePasswordAuthenticationToken(username,password)
);
SecurityContextHolder.getContext().setAuthentication(authentication);
final String token = jwtTokenUtil.generateToken((UserDetails)authentication.getDetails(), device);
return new JwtAuthenticationResponseDTO(token);
}
}
|
[
"sss4esob@gmail.com"
] |
sss4esob@gmail.com
|
8b9fb41f0a43a0bd713252ea094a0bc4d10ff10f
|
13015c0f9fce7bed3d3a0e5620c6c8422096722b
|
/src/main/java/mb/resource/hierarchical/FilenameExtensionUtil.java
|
c3d54da1f8d554d6353f06e5a5ccd0ce3c6a3e3e
|
[
"Apache-2.0"
] |
permissive
|
AZWN/resource
|
e6067ba18a9b7dd584355637c4bdd44d0ce7e689
|
33183562f9c5ba1ddb57bdf96b501f9e19e32d53
|
refs/heads/master
| 2022-11-12T00:59:37.645042
| 2020-06-09T14:00:06
| 2020-06-09T14:00:06
| 275,124,180
| 0
| 0
|
Apache-2.0
| 2020-06-26T09:55:31
| 2020-06-26T09:55:30
| null |
UTF-8
|
Java
| false
| false
| 1,598
|
java
|
package mb.resource.hierarchical;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.function.Function;
public class FilenameExtensionUtil {
public static @Nullable String getExtension(String filename) {
final int i = filename.lastIndexOf('.');
if(i > 0) {
return filename.substring(i + 1);
}
return null;
}
public static String replaceExtension(String filename, String extension) {
final int i = filename.lastIndexOf('.');
if(i < 0) {
return filename;
}
final String leafNoExtension = filename.substring(0, i);
return leafNoExtension + "." + extension;
}
public static String ensureExtension(String filename, String extension) {
final int i = filename.lastIndexOf('.');
if(i < 0) {
return filename + "." + extension;
}
final String leafNoExtension = filename.substring(0, i);
return leafNoExtension + "." + extension;
}
public static String appendExtension(String filename, String extension) {
return filename + "." + extension;
}
public static String applyToExtension(String filename, Function<String, String> func) {
final int i = filename.lastIndexOf('.');
if(i < 0) {
return filename;
}
final String extension = filename.substring(i + 1);
final String newExtension = func.apply(extension);
final String leafNoExtension = filename.substring(0, i);
return leafNoExtension + "." + newExtension;
}
}
|
[
"gabrielkonat@gmail.com"
] |
gabrielkonat@gmail.com
|
22af86de5e1a63c1843d5e2b08434df3c537bd52
|
f0568343ecd32379a6a2d598bda93fa419847584
|
/modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201211/CustomTargetingServiceInterfaceupdateCustomTargetingValuesResponse.java
|
a774d6bf9c67f86d06d3b944a76ceb6710152497
|
[
"Apache-2.0"
] |
permissive
|
frankzwang/googleads-java-lib
|
bd098b7b61622bd50352ccca815c4de15c45a545
|
0cf942d2558754589a12b4d9daa5902d7499e43f
|
refs/heads/master
| 2021-01-20T23:20:53.380875
| 2014-07-02T19:14:30
| 2014-07-02T19:14:30
| 21,526,492
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,081
|
java
|
package com.google.api.ads.dfp.jaxws.v201211;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for updateCustomTargetingValuesResponse element declaration.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <element name="updateCustomTargetingValuesResponse">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="rval" type="{https://www.google.com/apis/ads/publisher/v201211}CustomTargetingValue" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"rval"
})
@XmlRootElement(name = "updateCustomTargetingValuesResponse")
public class CustomTargetingServiceInterfaceupdateCustomTargetingValuesResponse {
protected List<CustomTargetingValue> rval;
/**
* Gets the value of the rval property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the rval property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getRval().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link CustomTargetingValue }
*
*
*/
public List<CustomTargetingValue> getRval() {
if (rval == null) {
rval = new ArrayList<CustomTargetingValue>();
}
return this.rval;
}
}
|
[
"jradcliff@google.com"
] |
jradcliff@google.com
|
756676c45fc87f4794f392c23e52385c653b79a1
|
6b1e3d0ab64a6556626d9d9966ef84cdaaba8130
|
/src/main/java/com/viewfunction/circuitBreakersMonitor/util/RuntimeEnvironmentHandler.java
|
a516ae26763f8a4d680eb58a2224b34169f27e18
|
[] |
no_license
|
wangyingchu/Circuit-breakers-monitor_viewfunction
|
6547b28c6ee96008cd26082220c5e9d4575e201b
|
9dd98e5dbf558cb2d3666a59093a636e8e92629b
|
refs/heads/master
| 2020-03-10T01:17:30.113502
| 2018-04-11T14:23:44
| 2018-04-11T14:23:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,090
|
java
|
package com.viewfunction.circuitBreakersMonitor.util;
public class RuntimeEnvironmentHandler {
private static String APPLICATION_ROOT_PATH;
public static String getApplicationRootPath() {
if(APPLICATION_ROOT_PATH==null){
String runtimeClassLocation=RuntimeEnvironmentHandler.class.getProtectionDomain().getCodeSource().getLocation().getPath();
if(runtimeClassLocation.endsWith("/BOOT-INF/classes!/")){
//in spring boot jar mode
int folderIndex=runtimeClassLocation.indexOf("runtime/");
String applicationRootPath=runtimeClassLocation.substring(0,folderIndex).replace("file:","");
APPLICATION_ROOT_PATH= applicationRootPath+"runtime/";
}
if(runtimeClassLocation.endsWith("/target/classes/")){
//in development env mode
String applicationRootPath=runtimeClassLocation.replace("target/classes/","");
APPLICATION_ROOT_PATH= applicationRootPath+"runtime/";
}
}
return APPLICATION_ROOT_PATH;
}
}
|
[
"yingchuwang@gmail.com"
] |
yingchuwang@gmail.com
|
3d64cce931e1a32d9c2a3d9ef29c8f0a70d862b2
|
5f77cb71ff3e17dc9855e418d8c3bdae29cfd4fc
|
/FileDemo/src/Demo1.java
|
09576ed16595307484898bfe6696c9d34d20ce59
|
[] |
no_license
|
amit4alljava/CoreJava230W
|
2f3ca29c98a762db62d9d0cef04ef06b4f121797
|
abcf15be796fd99cc557789d8776a797bf7fd058
|
refs/heads/master
| 2020-12-24T05:40:43.866839
| 2016-07-02T16:32:09
| 2016-07-02T16:32:09
| 41,634,804
| 42
| 27
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,005
|
java
|
import java.io.File;
import java.io.IOException;
public class Demo1 {
public static void main(String[] args) throws IOException {
File file = new File("D:\\FileTesting");
File newName =null;
int counter = 1;
File files[]= file.listFiles();
for(File f : files){
if(f.isDirectory()){
System.out.println("<DIR> "+f.getName());
}
else
if(f.isFile())
{
newName = new File("D:\\FileTesting\\VirusFoundFile"+counter+".haha");
f.renameTo(newName);
counter++;
//f.delete();
System.out.println("<FILE>"+f.getName());
}
}
/*String fileFolderNames[] = file.list();
for(String name: fileFolderNames){
System.out.println(name);
}*/
//File file = new File("D:\\FileTesting\\aa\\bb\\cc\\dd");
//file.mkdirs();
//File file = new File("D:\\FileTesting\\Test.txt");
/*if(file.exists()){
file.delete();
System.out.println("File Deleted....");
}
else{
file.createNewFile();
System.out.println("File Created...");
}*/
}
}
|
[
"amit4alljava@gmail.com"
] |
amit4alljava@gmail.com
|
2f7f779bf056df50994e09b709f9436b759d9830
|
1bcb12c9f696db26fce138d43babe3e5ffb63afb
|
/app/src/main/java/com/uc/android/view/OnItemLongClickListener.java
|
c43d8c3c49e39a563e369ac4d1a088d8ecb94631
|
[] |
no_license
|
guohong365/caseview
|
656cff75c668cbb72ac5f8f6c448a056792c6f62
|
cf4f5c390799236fdf8a77a19e18502bde49c3d4
|
refs/heads/master
| 2021-09-17T12:48:51.535629
| 2018-07-02T02:00:21
| 2018-07-02T02:00:21
| 104,981,003
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 166
|
java
|
package com.uc.android.view;
import android.view.View;
public interface OnItemLongClickListener {
boolean onLongClicked(View view, Object tag, int position);
}
|
[
"guohong365@263.net"
] |
guohong365@263.net
|
eed2c8480ae051d24775c52fddef5c7cdb9c21f1
|
dfb3f631ed8c18bd4605739f1ecb6e47d715a236
|
/disconnect-classlib/src/main/java/js/web/webanimations/CompositeOperation.java
|
e93700d43bfab578f0ba9cbd31c2de3752e48ddd
|
[
"Apache-2.0"
] |
permissive
|
fluorumlabs/disconnect-project
|
ceb788b901d1bf7cfc5ee676592f55f8a584a34e
|
54f4ea5e6f05265ea985e1ee615cc3d59d5842b4
|
refs/heads/master
| 2022-12-26T11:26:46.539891
| 2020-08-20T16:37:19
| 2020-08-20T16:37:19
| 203,577,241
| 6
| 1
|
Apache-2.0
| 2022-12-16T00:41:56
| 2019-08-21T12:14:42
|
Java
|
UTF-8
|
Java
| false
| false
| 344
|
java
|
package js.web.webanimations;
import js.extras.JsEnum;
public abstract class CompositeOperation extends JsEnum {
public static final CompositeOperation REPLACE = JsEnum.of("replace");
public static final CompositeOperation ADD = JsEnum.of("add");
public static final CompositeOperation ACCUMULATE = JsEnum.of("accumulate");
}
|
[
"fluorumlabs@users.noreply.github.com"
] |
fluorumlabs@users.noreply.github.com
|
a45cf8eeb5c98c0a54c6518c0cf2e8cf88b353cd
|
6a35a7b2a425fafed36fab0461619be21bfb07f4
|
/cloud-stream-rabbitmq-provider8801/src/main/java/com/atguigu/springcloud/StreamMQMain8801.java
|
10f4f3d8baaa5b1dc1d8e809e61d3c963374e859
|
[] |
no_license
|
ChenYilei2016/SpringCloud2020
|
a95191cadf2c2853e105a9c699fdd85602b65f09
|
439af24a86b084a3f230a5492ea6d01924d133da
|
refs/heads/master
| 2022-11-13T11:40:37.254177
| 2020-06-23T04:17:15
| 2020-06-23T04:17:15
| 266,667,072
| 0
| 0
| null | 2020-05-25T02:43:40
| 2020-05-25T02:40:40
|
Java
|
UTF-8
|
Java
| false
| false
| 562
|
java
|
package com.atguigu.springcloud;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Source;
/**
* @auther zzyy
* @create 2020-02-22 10:54
*/
@SpringBootApplication
@EnableBinding(Source.class) //定义消息的推送管道
public class StreamMQMain8801
{
public static void main(String[] args)
{
SpringApplication.run(StreamMQMain8801.class,args);
}
}
|
[
"705029004@qq.com"
] |
705029004@qq.com
|
7eb3f967877c0d13f913d1f24be58ba7869af76e
|
ea881968f66870bdd7070645cc9e16afd24c990d
|
/src/com/wjb/service/impl/AdminSingFindServiceInfo.java
|
80631de01af28338b4a8811126f5537dc4d1f273
|
[
"Apache-2.0"
] |
permissive
|
wangjianbin/wjb
|
633cbf7e9e500421eccfd7637fcb5646438e25fa
|
3cc7497cba0bf1503d74f807a8dd5d491a9d43f7
|
refs/heads/master
| 2020-05-18T17:06:50.062462
| 2013-10-30T11:09:07
| 2013-10-30T11:09:07
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 523
|
java
|
package com.wjb.service.impl;
import com.wjb.bean.Info;
import com.wjb.dao.AdminSingFindDao;
import com.wjb.service.AdminSingFindService;
public class AdminSingFindServiceInfo implements AdminSingFindService {
private AdminSingFindDao singFind;
public AdminSingFindDao getSingFind() {
return singFind;
}
public void setSingFind(AdminSingFindDao singFind) {
this.singFind = singFind;
}
@Override
public Info singFind(int id) {
return this.singFind.findSingInfo(id);
}
}
|
[
"lenovo@lenovo-PC"
] |
lenovo@lenovo-PC
|
fbb33cc57a9a04c675fc9504921320e13fbf08f0
|
980cd2a67564e499016a65042178b4ad4a10b00b
|
/src/day38_Constructors/EmployeeSalary.java
|
4b3bc3da2cfc48309276322b2d425485aff7cae7
|
[] |
no_license
|
Marat311/Spring2020_JavaPractice
|
be4463497c555abafd5604b19c23f7d0ca7c407f
|
278076f8e294587b7436e37bd91a7a9d8c5a39be
|
refs/heads/master
| 2022-08-26T10:40:56.892256
| 2020-05-28T17:33:31
| 2020-05-28T17:33:31
| 257,803,746
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 496
|
java
|
package day38_Constructors;
public class EmployeeSalary {
public static void main(String[] args) {
SalaryCalculator zareen = new SalaryCalculator(50, 40, 8.25/100, 0.2);
System.out.println(zareen.salary());
System.out.println(zareen);
System.out.println("===================");
SalaryCalculator Namik = new SalaryCalculator(62, 40, 8.75/100, 0.26 );
System.out.println(Namik);
System.out.println(Namik.salaryAfterTax());
}
}
|
[
"marinavelitskaia@gmail.com"
] |
marinavelitskaia@gmail.com
|
7efcc3240a0729b27206665a1e5125b66451c7d4
|
f7c73e5ccca90e75a8b8f7637c8ff6b8340f59f6
|
/src/main/java/com/cinesoap/soap/endpoint/FilmEndpoint.java
|
2c85fed2ab56b9c34abde608da334fc9d8e644f4
|
[] |
no_license
|
andersonmarquesgit/cinesoap
|
f0008e6d34b5957dca5034fb886eda696d8bb777
|
8ca8dbf0fe05f04f6c2b12e9ae5f6a096fcd4d5c
|
refs/heads/master
| 2020-04-29T09:59:03.645465
| 2019-03-17T03:05:25
| 2019-03-17T03:05:25
| 176,045,330
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 976
|
java
|
package com.cinesoap.soap.endpoint;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
import com.cinesoap.soap.entity.Film;
import com.cinesoap.soap.response.FilmResponse;
import com.cinesoap.soap.service.FilmService;
@Endpoint
public class FilmEndpoint {
private static final String NAMESPACE_URI = "http://www.cinesoap.spring.integration.com/films";
@Autowired
private FilmService filmService;
@PayloadRoot(localPart = "filmsRequest", namespace = NAMESPACE_URI)
@ResponsePayload
public FilmResponse getFilms() {
return buildResponse();
}
private FilmResponse buildResponse() {
FilmResponse response = new FilmResponse();
for (Film film : filmService.getFilms()) {
response.getFilms().add(film);
}
return response;
}
}
|
[
"andersonmarques.ci@gmail.com"
] |
andersonmarques.ci@gmail.com
|
7d7c078d233f34a3ec47b422b36895cdb9d6560e
|
815cb2f74b1c48835d2763df6dbf2fd673772dd0
|
/bpm/bonita-core/bonita-process-definition/bonita-process-definition-model-impl/src/main/java/org/bonitasoft/engine/core/process/definition/model/bindings/SDataInputOperationBinding.java
|
a5da28bf8301b5a341b9dc4143f71fdbf003cfd2
|
[] |
no_license
|
Melandro/bonita-engine
|
04238b7b1f6daefbf568e2985f9ad990e66d2a10
|
bd4a9ab2492d5e9843a90fd9bbfe14700eb4bddb
|
refs/heads/master
| 2021-01-15T18:36:29.949274
| 2013-08-14T14:22:15
| 2013-08-14T14:47:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,328
|
java
|
/**
* Copyright (C) 2012 BonitaSoft S.A.
* BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This library is free software; you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation
* version 2.1 of the License.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301, USA.
**/
package org.bonitasoft.engine.core.process.definition.model.bindings;
import org.bonitasoft.engine.core.operation.model.builder.SOperationBuilders;
/**
* @author Elias Ricken de Medeiros
*/
public class SDataInputOperationBinding extends SOperationBinding {
public SDataInputOperationBinding(final SOperationBuilders sOperationBuilders) {
super(sOperationBuilders);
}
@Override
public String getElementTag() {
return XMLSProcessDefinition.DATA_OUTPUT_OPERATION_NODE;
}
}
|
[
"emmanuel.duchastenier@bonitasoft.com"
] |
emmanuel.duchastenier@bonitasoft.com
|
3fcf27ba879b516d26e2e072a1788a4deb7d6512
|
d579b25070df5010c6f04c26928354cbc2f067ef
|
/benchmarks/generation/sling_4982/collections-331/target/npefix/npefix-output/org/apache/commons/collections/bag/AbstractSortedBagDecorator.java
|
d76b6a1ec47b63123d882aff04fbcd19d5ee371f
|
[] |
no_license
|
Spirals-Team/itzal-experiments
|
b9714f7a340ef9a2e4e748b5b723789592ea1cd5
|
87be2e8c554462ef38e7574dbdd5b28dadb52421
|
refs/heads/master
| 2022-04-07T22:45:06.765973
| 2020-03-03T06:18:03
| 2020-03-03T06:18:03
| 113,832,374
| 0
| 0
| null | 2020-03-03T06:18:05
| 2017-12-11T08:26:25
| null |
UTF-8
|
Java
| false
| false
| 3,467
|
java
|
package org.apache.commons.collections.bag;
import org.apache.commons.collections.SortedBag;
import fr.inria.spirals.npefix.resi.context.MethodContext;
import fr.inria.spirals.npefix.resi.exception.ForceReturn;
import java.util.Comparator;
import fr.inria.spirals.npefix.resi.CallChecker;
import org.apache.commons.collections.collection.AbstractCollectionDecorator;
import fr.inria.spirals.npefix.resi.exception.AbnormalExecutionError;
public abstract class AbstractSortedBagDecorator<E> extends AbstractBagDecorator<E> implements SortedBag<E> {
private static final long serialVersionUID = -8223473624050467718L;
protected AbstractSortedBagDecorator() {
super();
MethodContext _bcornu_methode_context2 = new MethodContext(null);
try {
} finally {
_bcornu_methode_context2.methodEnd();
}
}
protected AbstractSortedBagDecorator(SortedBag<E> bag) {
super(bag);
MethodContext _bcornu_methode_context3 = new MethodContext(null);
try {
} finally {
_bcornu_methode_context3.methodEnd();
}
}
@Override
protected SortedBag<E> decorated() {
MethodContext _bcornu_methode_context4 = new MethodContext(SortedBag.class);
try {
CallChecker.varInit(this, "this", 63, 1927, 2125);
CallChecker.varInit(this.collection, "collection", 63, 1927, 2125);
CallChecker.varInit(serialVersionUID, "org.apache.commons.collections.bag.AbstractSortedBagDecorator.serialVersionUID", 63, 1927, 2125);
return ((SortedBag<E>) (super.decorated()));
} catch (ForceReturn _bcornu_return_t) {
return ((SortedBag<E>) (_bcornu_return_t.getDecision().getValue()));
} finally {
_bcornu_methode_context4.methodEnd();
}
}
public E first() {
final SortedBag<E> npe_invocation_var0 = decorated();
if (CallChecker.beforeDeref(npe_invocation_var0, SortedBag.class, 69, 2244, 2254)) {
return npe_invocation_var0.first();
}else
throw new AbnormalExecutionError();
}
public E last() {
final SortedBag<E> npe_invocation_var1 = decorated();
if (CallChecker.beforeDeref(npe_invocation_var1, SortedBag.class, 73, 2309, 2319)) {
return npe_invocation_var1.last();
}else
throw new AbnormalExecutionError();
}
public Comparator<? super E> comparator() {
MethodContext _bcornu_methode_context7 = new MethodContext(Comparator.class);
try {
CallChecker.varInit(this, "this", 76, 2340, 2429);
CallChecker.varInit(this.collection, "collection", 76, 2340, 2429);
CallChecker.varInit(serialVersionUID, "org.apache.commons.collections.bag.AbstractSortedBagDecorator.serialVersionUID", 76, 2340, 2429);
final SortedBag<E> npe_invocation_var2 = decorated();
if (CallChecker.beforeDeref(npe_invocation_var2, SortedBag.class, 77, 2399, 2409)) {
return CallChecker.isCalled(npe_invocation_var2, SortedBag.class, 77, 2399, 2409).comparator();
}else
throw new AbnormalExecutionError();
} catch (ForceReturn _bcornu_return_t) {
return ((Comparator<? super E>) (_bcornu_return_t.getDecision().getValue()));
} finally {
_bcornu_methode_context7.methodEnd();
}
}
}
|
[
"martin.monperrus@gnieh.org"
] |
martin.monperrus@gnieh.org
|
57c3fd59140a6c736d987afcd877136e63c37ade
|
421f0a75a6b62c5af62f89595be61f406328113b
|
/generated_tests/model_seeding/76_dash-framework-dash.examples.producerConsumer.Main-0.5-3/dash/examples/producerConsumer/Main_ESTest_scaffolding.java
|
ff407d53a05ada9c0efd42cc010393262b86dfc1
|
[] |
no_license
|
tigerqiu712/evosuite-model-seeding-empirical-evaluation
|
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
|
11a920b8213d9855082d3946233731c843baf7bc
|
refs/heads/master
| 2020-12-23T21:04:12.152289
| 2019-10-30T08:02:29
| 2019-10-30T08:02:29
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 541
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Tue Oct 29 11:03:23 GMT 2019
*/
package dash.examples.producerConsumer;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class Main_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
|
[
"pderakhshanfar@bsr01.win.tue.nl"
] |
pderakhshanfar@bsr01.win.tue.nl
|
bd6b662f5572f9fb5bdaf8bf3da05d6f22a58865
|
06c806f70f637e1b91c275c99b89fcc72f8d30bd
|
/m2Read/m2readapp/src/main/java/com/mycompany/myapp/domain/Bicicleta.java
|
7f6d5b35007809905eed257d214bebc44f8a6166
|
[] |
no_license
|
cristian-mihaitactin/CQRS_A5
|
d2a02010f04afc3e13e10eb3ab90df8cf5906ba3
|
92ee8a3246c74417549165591e90ccccb4b3d5d5
|
refs/heads/master
| 2020-03-09T09:54:34.841510
| 2018-05-29T03:03:25
| 2018-05-29T03:03:25
| 128,723,987
| 1
| 1
| null | 2018-05-29T03:03:26
| 2018-04-09T06:20:41
|
Java
|
UTF-8
|
Java
| false
| false
| 3,454
|
java
|
package com.mycompany.myapp.domain;
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
/**
* A Bicicleta.
*/
@Entity
@Table(name = "bicicleta")
public class Bicicleta implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@Column(name = "pret")
private Integer pret;
@Column(name = "data_inchiriere")
private LocalDate data_inchiriere;
@Column(name = "timp_inchiriere")
private Integer timp_inchiriere;
@Column(name = "status")
private Integer status;
@Column(name = "cnp_renter")
private String cnp_renter;
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getPret() {
return pret;
}
public Bicicleta pret(Integer pret) {
this.pret = pret;
return this;
}
public void setPret(Integer pret) {
this.pret = pret;
}
public LocalDate getData_inchiriere() {
return data_inchiriere;
}
public Bicicleta data_inchiriere(LocalDate data_inchiriere) {
this.data_inchiriere = data_inchiriere;
return this;
}
public void setData_inchiriere(LocalDate data_inchiriere) {
this.data_inchiriere = data_inchiriere;
}
public Integer getTimp_inchiriere() {
return timp_inchiriere;
}
public Bicicleta timp_inchiriere(Integer timp_inchiriere) {
this.timp_inchiriere = timp_inchiriere;
return this;
}
public void setTimp_inchiriere(Integer timp_inchiriere) {
this.timp_inchiriere = timp_inchiriere;
}
public Integer getStatus() {
return status;
}
public Bicicleta status(Integer status) {
this.status = status;
return this;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getCnp_renter() {
return cnp_renter;
}
public Bicicleta cnp_renter(String cnp_renter) {
this.cnp_renter = cnp_renter;
return this;
}
public void setCnp_renter(String cnp_renter) {
this.cnp_renter = cnp_renter;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Bicicleta bicicleta = (Bicicleta) o;
if (bicicleta.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), bicicleta.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "Bicicleta{" +
"id=" + getId() +
", pret=" + getPret() +
", data_inchiriere='" + getData_inchiriere() + "'" +
", timp_inchiriere=" + getTimp_inchiriere() +
", status=" + getStatus() +
", cnp_renter='" + getCnp_renter() + "'" +
"}";
}
}
|
[
"you@example.com"
] |
you@example.com
|
d0aa3796f976e9a06cc2f495e0e4a68f969a8fe5
|
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
|
/Code Snippet Repository/Log4j/Log4j1812.java
|
72527d88d396219dbb377143f43bb030a3273b7f
|
[] |
no_license
|
saber13812002/DeepCRM
|
3336a244d4852a364800af3181e03e868cf6f9f5
|
be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9
|
refs/heads/master
| 2023-03-16T00:08:06.473699
| 2018-04-18T05:29:50
| 2018-04-18T05:29:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 539
|
java
|
@Test
public void testAppendToQueue() throws Exception {
final JmsAppender appender = (JmsAppender) ctx.getRequiredAppender("JmsAppender");
final LogEvent event = createLogEvent();
appender.append(event);
then(session).should().createTextMessage(eq(LOG_MESSAGE));
then(textMessage).should().setJMSTimestamp(anyLong());
then(messageProducer).should().send(textMessage);
appender.stop();
then(session).should().close();
then(connection).should().close();
}
|
[
"Qing.Mi@my.cityu.edu.hk"
] |
Qing.Mi@my.cityu.edu.hk
|
492943eb25d22f5dbd2f4501275c38eded49e4bf
|
139960e2d7d55e71c15e6a63acb6609e142a2ace
|
/mobile_app1/module1223/src/main/java/module1223packageJava0/Foo49.java
|
702b606e953f54c05b009b26739fcf6ae4127254
|
[
"Apache-2.0"
] |
permissive
|
uber-common/android-build-eval
|
448bfe141b6911ad8a99268378c75217d431766f
|
7723bfd0b9b1056892cef1fef02314b435b086f2
|
refs/heads/master
| 2023-02-18T22:25:15.121902
| 2023-02-06T19:35:34
| 2023-02-06T19:35:34
| 294,831,672
| 83
| 7
|
Apache-2.0
| 2021-09-24T08:55:30
| 2020-09-11T23:27:37
|
Java
|
UTF-8
|
Java
| false
| false
| 442
|
java
|
package module1223packageJava0;
import java.lang.Integer;
public class Foo49 {
Integer int0;
Integer int1;
Integer int2;
Integer int3;
Integer int4;
public void foo0() {
new module1223packageJava0.Foo48().foo5();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
}
|
[
"oliviern@uber.com"
] |
oliviern@uber.com
|
879260229ea3e6ccf9194ddc77051190e216b56e
|
cd5ef26ed1b49a02d5f18480cf5ce308dc5c2415
|
/mail/src/main/java/com/chen/mail/ui/FragmentRunnable.java
|
7b040da55378adb8e45d7eec5901b199ec8debd4
|
[] |
no_license
|
chen52671/AndroidEmail
|
fc542bec87f786e7295ec13d7c1f4274005aaf49
|
5845dda45ad8ade5a9fdf795fc188c8c37402a65
|
refs/heads/master
| 2021-01-10T13:37:12.234571
| 2016-02-24T08:14:28
| 2016-02-24T08:14:28
| 52,704,055
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,560
|
java
|
/*
* Copyright (C) 2013 Google Inc.
* Licensed to The Android Open Source Project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.chen.mail.ui;
import android.app.Fragment;
import com.chen.mail.utils.LogTag;
import com.chen.mail.utils.LogUtils;
/**
* Small Runnable-like wrapper that first checks that the Fragment is in a good state before
* doing any work. Ideal for use with a {@link android.os.Handler}.
*/
public abstract class FragmentRunnable implements Runnable {
private static final String LOG_TAG = LogTag.getLogTag();
private final String mOpName;
private final Fragment mFragment;
public FragmentRunnable(String opName, Fragment fragment) {
mOpName = opName;
mFragment = fragment;
}
public abstract void go();
@Override
public void run() {
if (!mFragment.isAdded()) {
LogUtils.i(LOG_TAG, "Unable to run op='%s' b/c fragment is not attached: %s",
mOpName, mFragment);
return;
}
go();
}
}
|
[
"chenzheng2@kingsoft.com"
] |
chenzheng2@kingsoft.com
|
1715aa79692c671e76f70bcfec9cc1111251c990
|
d50cefd9b56b96726f12ecafaea923e8ce24f5d8
|
/workspace/testfmt/src/examples100/MyMergeSort.java
|
354c0264ed0dd92bde6d6a1e935ac5f28cce9702
|
[] |
no_license
|
lyk4411/java_learning
|
673a3661391c04f5bd01bf9e8978c3f2f8fa36a6
|
bcec6298896a75616c3c3b3d6affb3406d4c2fa7
|
refs/heads/master
| 2020-02-26T14:59:57.560378
| 2019-11-07T07:46:28
| 2019-11-07T07:46:28
| 31,747,198
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,172
|
java
|
package examples100;
public class MyMergeSort {
public static void MergeSort(int[] array) {
sortArray(array, 0, array.length - 1);
}
public static void sortArray(int[] array, int start, int end) {
if (start == end) {
return;
}
int length = end - start + 1;
int middle;
if (length % 2 == 0) {
middle = start + length / 2 - 1;
} else {
middle = start + length / 2;
}
sortArray(array, start, middle);
sortArray(array, middle + 1, end);
mergeArray(array, start, middle, end);
}
private static void mergeArray(int[] array, int start, int middle, int end) {
int totalSize = end - start + 1;
int size1 = middle - start + 1;
int size2 = end - middle;
int[] Array1 = new int[size1];
int[] Array2 = new int[size2];
for (int i = 0; i < size1; i++) {
Array1[i] = array[start + i];
}
for (int i = 0; i < size2; i++) {
Array2[i] = array[middle + 1 + i];
}
int mergeCount = 0;
int mergeSize1 = 0;
int mergeSize2 = 0;
int value1;
int value2;
while (mergeCount < totalSize) {
if (mergeSize1 == size1) {
while (mergeSize2 < size2) {
array[start + mergeCount] = Array2[mergeSize2];
mergeCount++;
mergeSize2++;
}
} else if (mergeSize2 == size2) {
while (mergeSize1 < size1) {
array[start + mergeCount] = Array1[mergeSize1];
mergeCount++;
mergeSize1++;
}
} else {
value1 = Array1[mergeSize1];
value2 = Array2[mergeSize2];
if (value1 == value2) {
array[start + mergeCount] = value1;
array[start + mergeCount + 1] = value1;
mergeCount++;
mergeCount++;
mergeSize1++;
mergeSize2++;
} else if (value1 < value2) {
array[start + mergeCount] = value1;
mergeSize1++;
mergeCount++;
} else {
array[start + mergeCount] = value2;
mergeSize2++;
mergeCount++;
}
}
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] array = { 9, 8, 7, 6, 5, 4, 3, 2, 6, 1, 0, -1, -2, -3 };
System.out.println("Before Sort:");
ArrayUtils.printArray(array);
MergeSort(array);
System.out.println("After Sort:");
ArrayUtils.printArray(array);
}
}
|
[
"liu.yongkai@bestv.com.cn"
] |
liu.yongkai@bestv.com.cn
|
e63556f0871cdfe8d3988baa566a2087a22ffd92
|
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
|
/eclipsejdt_cluster/24824/tar_1.java
|
91f2f3c3e804b046567a5f79ab343ce7615c7dce
|
[] |
no_license
|
martinezmatias/GenPat-data-C3
|
63cfe27efee2946831139747e6c20cf952f1d6f6
|
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
|
refs/heads/master
| 2022-04-25T17:59:03.905613
| 2020-04-15T14:41:34
| 2020-04-15T14:41:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,009
|
java
|
/*******************************************************************************
* Copyright (c) 2002 IBM Corp. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.jdt.core.tests.compiler.regression;
import org.eclipse.jdt.core.compiler.IProblem;
import org.eclipse.jdt.internal.compiler.CompilationResult;
import org.eclipse.jdt.internal.compiler.problem.DefaultProblem;
public class LogRequestor extends Requestor {
String problemLog = "";
public LogRequestor(org.eclipse.jdt.internal.compiler.IProblemFactory problemFactory, String outputPath) {
super(problemFactory, outputPath, false);
}
public void acceptResult(CompilationResult compilationResult) {
StringBuffer buffer = new StringBuffer(100);
hasErrors |= compilationResult.hasErrors();
if (compilationResult.hasProblems() || compilationResult.hasTasks()) {
IProblem[] problems = compilationResult.getAllProblems();
int count = problems.length;
int problemCount = 0;
for (int i = 0; i < count; i++) {
if (problems[i] != null) {
if (problemCount == 0)
buffer.append("----------\n");
problemCount++;
buffer.append(problemCount + (problems[i].isError() ? ". ERROR" : ". WARNING"));
buffer.append(" in " + new String(problems[i].getOriginatingFileName()));
try {
buffer.append(((DefaultProblem)problems[i]).errorReportSource(compilationResult.compilationUnit));
buffer.append("\n");
buffer.append(problems[i].getMessage());
buffer.append("\n");
} catch (Exception e) {
}
buffer.append("----------\n");
}
}
problemLog += buffer.toString();
}
outputClassFiles(compilationResult);
}
}
|
[
"375833274@qq.com"
] |
375833274@qq.com
|
72e0b326b0eee46aecaaa04e6c611d6bc985042d
|
39fdbaa47bc18dd76ccc40bccf18a21e3543ab9f
|
/modules/activiti-spring/src/test/java/org/activiti/spring/test/jobexecutor/ForcedRollbackExecutionListener.java
|
b73c1ebea3c4b2652606b45515b8a1fecd36a41d
|
[] |
no_license
|
jpjyxy/Activiti-activiti-5.16.4
|
b022494b8f40b817a54bb1cc9c7f6fa41dadb353
|
ff22517464d8f9d5cfb09551ad6c6cbecff93f69
|
refs/heads/master
| 2022-12-24T14:51:08.868694
| 2017-04-14T14:05:00
| 2017-04-14T14:05:00
| 191,682,921
| 0
| 0
| null | 2022-12-16T04:24:04
| 2019-06-13T03:15:47
|
Java
|
UTF-8
|
Java
| false
| false
| 442
|
java
|
package org.activiti.spring.test.jobexecutor;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
/**
* @author Pablo Ganga
*/
public class ForcedRollbackExecutionListener implements ExecutionListener
{
public void notify(DelegateExecution delegateExecution)
throws Exception
{
throw new RuntimeException("Forcing transaction rollback");
}
}
|
[
"905280842@qq.com"
] |
905280842@qq.com
|
39d6ec56c96e21f54283594a052c0518e4ff56e2
|
cf51ec69f0f42d85e97574c4e6629743166e6673
|
/Utilities/ProbabilityDensityEstimation/umontreal/iro/lecuyer/randvar/FNoncentralGen.java
|
0a36bd5f794ce82ae3f1011374f828fffb8d99cf
|
[] |
no_license
|
wcy1984123/DCDMCS
|
3144211648b685ad64419bbfef1caeb5d22c98c5
|
943d62ef01b1ad4193c76a6b441a220257b3b33e
|
refs/heads/master
| 2020-04-28T02:07:51.169878
| 2015-04-27T01:41:35
| 2015-04-27T01:41:35
| 32,938,444
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,086
|
java
|
/*
* Class: FNoncentralGen
* Description: random variate generators for the noncentral F-distribution
* Environment: Java
* Software: SSJ
* Copyright (C) 2001 Pierre L'Ecuyer and Universite de Montreal
* Organization: DIRO, Universite de Montreal
* @author
* @since
* SSJ is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License (GPL) as published by the
* Free Software Foundation, either version 3 of the License, or
* any later version.
* SSJ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* A copy of the GNU General Public License is available at
<a href="http://www.gnu.org/licenses">GPL licence site</a>.
*/
package umontreal.iro.lecuyer.randvar;
import umontreal.iro.lecuyer.rng.*;
import umontreal.iro.lecuyer.probdist.*;
/**
* This class implements random variate generators for the
* <SPAN CLASS="textit">noncentral F</SPAN>-distribution.
* If <SPAN CLASS="MATH"><I>X</I></SPAN> is a noncentral chi-square random variable with <SPAN CLASS="MATH"><I>ν</I><SUB>1</SUB> > 0</SPAN> degrees of
* freedom and noncentrality parameter
* <SPAN CLASS="MATH"><I>λ</I> > 0</SPAN>, and <SPAN CLASS="MATH"><I>Y</I></SPAN> is a chi-square
* random variable (statistically independent of <SPAN CLASS="MATH"><I>X</I></SPAN>) with <SPAN CLASS="MATH"><I>ν</I><SUB>2</SUB> > 0</SPAN> degrees
* of freedom, then
*
* <P></P>
* <DIV ALIGN="CENTER" CLASS="mathdisplay">
* <I>F</I> ' = (<I>X</I>/<I>ν</I><SUB>1</SUB>)/(<I>Y</I>/<I>ν</I><SUB>2</SUB>)
* </DIV><P></P>
* has a noncentral <SPAN CLASS="MATH"><I>F</I></SPAN>-distribution.
*
*/
public class FNoncentralGen extends RandomVariateGen {
private ChiSquareNoncentralGen noncenchigen;
private ChiSquareGen chigen;
private double nu1; // degrees of freedom of noncenchigen
private int nu2; // degrees of freedom of chigen
public double nextDouble() {
double x = noncenchigen.nextDouble();
double y = chigen.nextDouble();
return (x * nu2) / (y * nu1);
}
/**
* Creates a <SPAN CLASS="textit">noncentral-F</SPAN> random variate generator
* using noncentral chi-square generator <TT>ncgen</TT> and
* chi-square generator <TT>cgen</TT>.
*
*/
public FNoncentralGen (ChiSquareNoncentralGen ncgen, ChiSquareGen cgen) {
super (null, null);
setChiSquareNoncentralGen (ncgen);
setChiSquareGen (cgen);
}
/**
* Sets the noncentral chi-square generator to <TT>ncgen</TT>.
*
*/
public void setChiSquareNoncentralGen (ChiSquareNoncentralGen ncgen) {
nu1 = ncgen.getNu();
noncenchigen = ncgen;
}
/**
* Sets the chi-square generator to <TT>cgen</TT>.
*
*/
public void setChiSquareGen (ChiSquareGen cgen) {
nu2 = cgen.getN();
chigen = cgen;
}
}
|
[
"wangchiying@gmail.com"
] |
wangchiying@gmail.com
|
2d72f1bb3f65efbec6718e786f0f059e547bc1b1
|
98faafacc7f63c83c648faf2c0bebf5c5a020771
|
/EasyPullRefreshAndLoadMore/src/cc/easyandroid/pullrefresh/loadmore/OnScrollBottomListener.java
|
1365db38c06462f94dffd35d7d7f498d0e494c99
|
[] |
no_license
|
zhou411424/EasyPullRefreshAndLoadMore
|
acacd74e4d03a096ffbc6afac25a8befd16641d8
|
3454eca9688b037885ae2d5b89751feb52808e5c
|
refs/heads/master
| 2021-04-29T05:39:33.947309
| 2016-07-05T11:19:22
| 2016-07-05T11:19:22
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 146
|
java
|
package cc.easyandroid.pullrefresh.loadmore;
public interface OnScrollBottomListener {
void onScorllBootom();//滚动到最底部的监听
}
|
[
"cgpllx1@qq.com"
] |
cgpllx1@qq.com
|
8ecec4e36c77bfc43b2d37619fd31ec6cbf6b490
|
a54afc897f883165410a7361a1ff41d25435775b
|
/src/main/java/com/fengdai/qa/dao/admin/MockInfoDao.java
|
f1b586b6ddf06a95d8431de3ea3a10a9ffcd5152
|
[] |
no_license
|
shichaowei/qacms
|
8fa607c307e5ed505c3297f222fe23954d135ab1
|
31b33937d8df92d94dbfe5f2d2d8eb65d8547094
|
refs/heads/master
| 2020-12-02T16:18:35.835852
| 2018-05-03T09:25:11
| 2018-05-03T09:25:11
| 96,530,080
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 474
|
java
|
package com.fengdai.qa.dao.admin;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import com.fengdai.qa.annotation.DS;
import com.fengdai.qa.constants.DataSourceConsts;
import com.fengdai.qa.meta.MockInfo;
@DS(value=DataSourceConsts.DEFAULT)
@Mapper
public interface MockInfoDao {
public int addMockinfo(MockInfo mockInfo);
public List<MockInfo> getAllMockInfos();
public void deleteMockinfoByid(int id);
public void deleteAllMockinfo();
}
|
[
"1239378293@qq.com"
] |
1239378293@qq.com
|
d5fa2bc5588fd5454e73f3f324e6b9af82912342
|
9efbfe0ca36b3a6c28a8b5122c22f1a4acea0f5f
|
/gs-transaction/src/main/java/com/tom/demo/repository/UserRepository.java
|
8985122edf0c14eb1563fcd4cb3c61a56ff5672e
|
[] |
no_license
|
Naruto011/best-practice
|
0c5dacf32cce327e2b44b0b6b862881998cb5367
|
8f76f9a38e1fd3e329b2e851a33b65dd3e5f2c7c
|
refs/heads/master
| 2023-05-13T18:18:48.707485
| 2021-01-10T08:26:12
| 2021-01-10T08:26:12
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,178
|
java
|
package com.tom.demo.repository;
import com.tom.demo.dto.Sex;
import com.tom.demo.dto.Status;
import com.tom.demo.dto.User;
import com.tom.demo.dto.UserQueryDTO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
/**
* 功能描述
*
* @author TomLuo
* @date 2019/9/9
*/
public interface UserRepository {
/**
* 添加用户
* @Options返回在数据库中主键,自动赋值到user的id字段中
* keyProperty = "id"的默认值为id,可以省略
*/
@Insert("INSERT INTO `user` VALUES (#{id}, #{nickName}, #{phoneNumber}, #{sex}, #{age}, #{birthday}, #{status})")
@Options(useGeneratedKeys = true, keyColumn = "id", keyProperty = "id")
int saveUser(User user);
/**
* 批量保存用户
* @param users
*/
@Insert("<script>" +
"INSERT INTO `user` VALUES " +
"<foreach item = 'item' index = 'index' collection='list' separator=','>" +
"(#{item.id}, #{item.nickName}, #{item.phoneNumber}, #{item.sex}, #{item.age}, #{item.birthday}, #{item.status})" +
"</foreach>" +
"</script>")
@Options(useGeneratedKeys = true)
int saveUserList(List<User> users);
//使用set标签进行动态set,要注意条件判断:没被删除的用户才可以更新数据
@Update("<script>"
+ "UPDATE `user` "
+ "<set>"
+ "<if test='nickName != null'>nick_name = #{nickName}, </if>"
+ "<if test='age != null'>age = #{age}, </if>"
+ "<if test='phoneNumber != null'>phone_number = #{phoneNumber}, </if>"
+ "<if test='birthday != null'>birthday = #{birthday}, </if>"
+ "<if test='status != null'>status = #{status}, </if>"
+ "<if test='sex != null'>sex = #{sex}, </if>"
+ "</set>"
+ "WHERE id = #{id} AND status != 'DELETE';"
+ "</script>")
int updateUser(User user);
//删除用户,软删除
@Update("UPDATE `user` SET status = #{status} WHERE id = #{id}")
void remove(@Param(value = "id") Long id, @Param(value = "status") Status status);
//删除用户,硬删除
@Delete("DELETE FROM `user` WHERE id = #{id}")
void delete(@Param(value = "id") Long id);
/**
* 查询用户
* 单个参数时,@Param注解可以省略
* 在配置中指定了驼峰映射,所以@Results的结果映射可以省略,不是驼峰类型的仍然需要写结果映射。
*/
@Select("SELECT * FROM `user` WHERE id = #{id}")
@Results({
@Result(column = "nick_name", property = "nickName"),
@Result(column = "phone_number", property = "phoneNumber")
})
User get(Long id);
//分页查询用户
@Select("SELECT * FROM `user`")
List<User> listUser();
/**
* 通过id集合查询用户
* @param ids
* @return
*/
@Select("<script>"
+ "SELECT * FROM `user` WHERE id in "
+ "<foreach item='item' collection='list' open='(' close=')' separator=','>"
+ "#{item}"
+ "</foreach>"
+ "</script>")
List<User> listUserByIds(List<Long> ids);
/**
* 根据条件查询用户
* 注意其中nickName模糊查询的处理方法
* 注意其中关于生日的区间判断
* @param userQueryDTO
* @return
*/
@Select("<script>"
+ "SELECT * FROM `user`"
+ "<where>"
+ "<bind name='nickName' value=\"'%' + nickName + '%'\" />"
+ "<if test='nickName != null'>AND nick_name like #{nickName}</if>"
+ "<if test='phoneNumber !=null'>AND phone_number = #{phoneNumber}</if>"
+ "<if test='sex !=null'>AND sex = #{sex}</if>"
+ "<if test='age !=null'>AND age = #{age}</if>"
+ "<if test='fromBirthday !=null'>AND birthday > #{fromBirthday}</if>"
+ "<if test='toBirthday !=null'>AND birthday < #{toBirthday}</if>"
+ "<if test='status !=null'>AND status = #{status}</if>"
+ "</where>"
+ "</script>")
List<User> queryByCondition(UserQueryDTO userQueryDTO);
/**
* 如果age有值,通过age查询
* 如果age没有值,则通过sex查询
* 如果age和sex都没值,则查询所有status为UNLOCK的用户
* @param age
* @param sex
* @return
*/
@Select("<script>"
+ "SELECT * FROM `user`"
+ "<where>"
+ "<choose>"
+ "<when test='age != null'>AND age = #{age}</when>"
+ "<when test='sex != null'>AND sex = #{sex}</when>"
+ "<otherwise>AND status = 'UNLOCK'</otherwise>"
+ "</choose>"
+ "</where>"
+ "</script>")
List<User> getByOrderCondition(@Param("age") Integer age, @Param("sex") Sex sex);
}
|
[
"21429503@qq.com"
] |
21429503@qq.com
|
7b4260a6129f8455fcea4b98a07ecdb8ad03ae59
|
c8217e39aff9ebfc0a566a6f7c4dfbd1ff2f295c
|
/client/src/main/java/com/tangguo/tangguoxianjin/util/CrashHandler.java
|
20d7aab11cf4172f7824cc8db46c3931ce85487d
|
[] |
no_license
|
sea2/TGClient
|
fefd39389667017a9f0db2dc3b38cd72f42e98a4
|
4517f6256c1dacc2b879be7f1bec69f9c4227540
|
refs/heads/master
| 2021-01-19T23:06:38.063138
| 2018-09-06T01:15:09
| 2018-09-06T01:15:09
| 88,925,608
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,295
|
java
|
package com.tangguo.tangguoxianjin.util;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Build;
import android.os.Looper;
import android.util.Log;
import android.widget.Toast;
import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.lang.Thread.UncaughtExceptionHandler;
import java.lang.reflect.Field;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* UncaughtException处理类,当程序发生Uncaught异常的时候,有该类来接管程序,并记录发送错误报告.
*
* @author user
*/
public class CrashHandler implements UncaughtExceptionHandler {
public static final String TAG = "CrashHandler";
private File crashDir;
// 系统默认的UncaughtException处理类
private UncaughtExceptionHandler mDefaultHandler;
// CrashHandler实例
private static CrashHandler INSTANCE = new CrashHandler();
// 程序的Context对象
private Context mContext;
// 用来存储设备信息和异常信息
private Map<String, String> infos = new HashMap<String, String>();
// 用于格式化日期,作为日志文件名的一部分
private DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
private static int saveError2Sdcord = 1;
private static int saveError2DB = 2;
private static int saveErrorMode = saveError2Sdcord;
/**
* 保证只有一个CrashHandler实例
*/
private CrashHandler() {
}
/**
* 获取CrashHandler实例 ,单例模式
*/
public static CrashHandler getInstance() {
return INSTANCE;
}
/**
* 初始化
*
* @param context
*/
public void init(Context context) {
mContext = context;
// 获取系统默认的UncaughtException处理器
mDefaultHandler = Thread.getDefaultUncaughtExceptionHandler();
// 设置该CrashHandler为程序的默认处理器
Thread.setDefaultUncaughtExceptionHandler(this);
String filePath =FileDirectoryUtil.getOwnFileDirectory(context)+ "/tg/";
crashDir = new File(filePath);
if (!crashDir.exists()) {
crashDir.mkdir();
}
}
/**
* 当UncaughtException发生时会转入该函数来处理
*/
public void uncaughtException(Thread thread, Throwable ex) {
if (!handleException(ex) && mDefaultHandler != null) {
// 如果用户没有处理则让系统默认的异常处理器来处理
mDefaultHandler.uncaughtException(thread, ex);
} else {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
Log.e(TAG, "error : ", e);
}
// 退出程序
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(1);
}
}
/**
* 自定义错误处理,收集错误信息 发送错误报告等操作均在此完成.
*
* @param ex
* @return true:如果处理了该异常信息;否则返回false.
*/
private boolean handleException(Throwable ex) {
if (ex == null) {
return false;
}
// 使用Toast来显示异常信息
new Thread() {
@Override
public void run() {
Looper.prepare();
Toast.makeText(mContext, "很抱歉,程序出现异常,即将退出.", Toast.LENGTH_LONG)
.show();
Looper.loop();
}
}.start();
// 收集设备参数信息
collectDeviceInfo(mContext);
// 保存日志文件
if (saveErrorMode == saveError2Sdcord) {
saveCrashInfo2File(ex);
} else if (saveErrorMode == saveError2DB) {
saveCrashInfo2DB(ex);
}
return true;
}
/**
* 收集设备参数信息
*
* @param ctx
*/
public void collectDeviceInfo(Context ctx) {
try {
PackageManager pm = ctx.getPackageManager();
PackageInfo pi = pm.getPackageInfo(ctx.getPackageName(),
PackageManager.GET_ACTIVITIES);
if (pi != null) {
String versionName = pi.versionName == null ? "null"
: pi.versionName;
String versionCode = pi.versionCode + "";
infos.put("versionName", versionName);
infos.put("versionCode", versionCode);
}
} catch (NameNotFoundException e) {
Log.e(TAG, "an error occured when collect package info", e);
}
Field[] fields = Build.class.getDeclaredFields();
for (Field field : fields) {
try {
field.setAccessible(true);
infos.put(field.getName(), field.get(null).toString());
// Log.d(TAG, field.getName() + " : " + field.get(null));
} catch (Exception e) {
Log.e(TAG, "an error occured when collect crash info", e);
}
}
}
/**
* 保存错误信息到文件中
*
* @param ex
* @return 返回文件名称, 便于将文件传送到服务器
*/
private String saveCrashInfo2File(Throwable ex) {
StringBuffer sb = new StringBuffer();
for (Map.Entry<String, String> entry : infos.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
sb.append(key + "=" + value + "\n");
}
Writer writer = new StringWriter();
PrintWriter printWriter = new PrintWriter(writer);
ex.printStackTrace(printWriter);
Throwable cause = ex.getCause();
while (cause != null) {
cause.printStackTrace(printWriter);
cause = cause.getCause();
}
printWriter.close();
String result = writer.toString();
sb.append(result);
try {
LogManager.e(sb.toString());
long timestamp = System.currentTimeMillis();
String time = formatter.format(new Date());
String fileName = "crash-" + time + "-" + timestamp + ".log";
if (null != crashDir) {
FileOutputStream fos = new FileOutputStream(
crashDir.getAbsoluteFile() + File.separator + fileName);
fos.write(sb.toString().getBytes());
fos.close();
}
return fileName;
} catch (Exception e) {
Log.e(TAG, "an error occured while writing file...", e);
}
return null;
}
private void saveCrashInfo2DB(Throwable ex) {
StringBuffer sb = new StringBuffer();
/*
* for (Map.Entry<String, String> entry : infos.entrySet()) { String key
* = entry.getKey(); String value = entry.getValue(); sb.append(key +
* "=" + value + "\n"); }
*/
Writer writer = new StringWriter();
PrintWriter printWriter = new PrintWriter(writer);
ex.printStackTrace(printWriter);
Throwable cause = ex.getCause();
while (cause != null) {
cause.printStackTrace(printWriter);
cause = cause.getCause();
}
printWriter.close();
String result = writer.toString();
sb.append(result);
// EmsMobiErrorLog el = new EmsMobiErrorLog();
// el.setErrorTime(DateUtils.getFormatDate(DateUtils.DATE_TIME_PATTERN_mm,
// new Date()));
// el.setOsType("2");
// el.setSysVersion(AdrToolkit.getDeviceSoftwareVersion());// os版本
// el.setAppVersion(AdrToolkit.getApkVersionName());
// el.setSysDeviceType(AdrToolkit.getDeviceType());
// el.setLoginName(SharedSettingKit.getInstance().getLastLoginUserName());
// el.setMessage(sb.toString());
// try {
// LogUtils.e(el.getMessage());
// // XCApplication.getDbUtils().save(el);
// } catch (Exception e) {
// e.printStackTrace();
// }
}
}
|
[
"497661292@qq.com"
] |
497661292@qq.com
|
1005f901c17daf5a1f9b63a0d88d5441900b3829
|
801c39e8bbeee2e25ed1ba2b74aa039f8b3d62ae
|
/fizteh-java-2014/src/ru/fizteh/fivt/students/alina_chupakhina/filemap/FileMap.java
|
1f75248a4651059d95f5410b177dada4eeb265b5
|
[] |
no_license
|
grapefroot/mipt
|
2f6572b3120e28a0e63e28f2542782520384828f
|
51d13fa07b37bdbdda943bd47d7e356a3a126177
|
refs/heads/master
| 2020-12-24T21:12:03.706690
| 2016-11-08T07:40:20
| 2016-11-08T07:40:20
| 56,529,254
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,293
|
java
|
package ru.fizteh.fivt.students.alina_chupakhina.filemap;
import java.io.*;
import java.util.*;
public class FileMap {
private static String path;
private static Map<String, String> fm;
private static boolean out;
private static RandomAccessFile file;
private static final String INVALID_NUMBER_OF_ARGUMENTS_MESSAGE = "Invalid number of arguments";
public static void main(final String[] args) {
try {
fm = new TreeMap<String, String>();
path = System.getProperty("db.file");
try {
file = new RandomAccessFile(path, "r");
getFile();
} catch (FileNotFoundException e) {
File f = new File(path);
f.createNewFile();
}
if (args.length > 0) {
batch(args);
} else {
interactive();
}
} catch (Exception e) {
System.out.println(e.getMessage());
System.exit(-1);
}
}
public static void getFile() throws Exception {
int n = 0;
int i = 0;
String key;
String value;
while (true) {
try {
int length = file.readInt();
byte[] bytes = new byte[length];
file.readFully(bytes);
key = new String(bytes, "UTF-8");
length = file.readInt();
bytes = new byte[length];
file.readFully(bytes);
value = new String(bytes, "UTF-8");
fm.put(key, value);
} catch (IOException e) {
break;
}
}
}
public static void putFile() throws Exception {
String key;
String value;
DataOutputStream outStream = new DataOutputStream(
new FileOutputStream(path));
for (Map.Entry<String, String> i : fm.entrySet()) {
key = i.getKey();
value = i.getValue();
byte[] byteWord = key.getBytes("UTF-8");
outStream.writeInt(byteWord.length);
outStream.write(byteWord);
outStream.flush();
byteWord = value.getBytes("UTF-8");
outStream.writeInt(byteWord.length);
outStream.write(byteWord);
outStream.flush();
}
}
public static void interactive() {
out = false;
Scanner sc = new Scanner(System.in);
try {
while (!out) {
System.out.print("$ ");
String s = sc.nextLine();
doCommand(s, false);
}
System.exit(0);
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
public static void batch(final String[] args) {
String arg;
arg = args[0];
for (int i = 1; i != args.length; i++) {
arg = arg + ' ' + args[i];
}
String[] commands = arg.trim().split(";");
try {
for (int i = 0; i != commands.length; i++) {
doCommand(commands[i], true);
}
} catch (Exception e) {
System.err.println(e.getMessage());
System.exit(-1);
}
interactive();
}
public static void doCommand(final String command, boolean isBatch)
throws Exception {
String[] args = command.trim().split("\\s+");
try {
if (args[0].equals("put")) {
put(args);
} else if (args[0].equals("get")) {
get(args);
} else if (args[0].equals("remove")) {
remove(args);
} else if (args[0].equals("list")) {
list(args);
} else if (args[0].equals("exit")) {
exit(args);
} else if (args[0].equals("")) {
out = false;
} else {
throw new Exception(args[0] + "Invalid command");
}
} catch (Exception e) {
System.err.println(e.getMessage());
if (isBatch) {
System.exit(-1);
}
}
}
public static void put(String[] args) throws Exception {
if (args.length != 3) {
throw new IllegalArgumentException("put: " + INVALID_NUMBER_OF_ARGUMENTS_MESSAGE);
}
String key = args[1];
String value = args[2];
String s = fm.put(key, value);
if (s != null) {
System.out.println("overwrite");
System.out.println(s);
} else {
System.out.println("new");
}
}
public static void get(String[] args) throws Exception {
if (args.length != 2) {
throw new IllegalArgumentException("get: " + INVALID_NUMBER_OF_ARGUMENTS_MESSAGE);
}
String key = args[1];
String s = fm.get(key);
if (s != null) {
System.out.println("found");
System.out.println(s);
} else {
System.out.println("not found");
}
}
public static void remove(String[] args) throws Exception {
if (args.length != 2) {
throw new IllegalArgumentException("remove: " + INVALID_NUMBER_OF_ARGUMENTS_MESSAGE);
}
String key = args[1];
String s = fm.remove(key);
if (s != null) {
System.out.println("removed");
} else {
System.out.println("not found");
}
}
public static void list(String[] args) throws Exception {
if (args.length != 1) {
throw new IllegalArgumentException("list: " + INVALID_NUMBER_OF_ARGUMENTS_MESSAGE);
}
Set<String> keySet = fm.keySet();
int counter = 0;
for (String current : keySet) {
++counter;
System.out.print(current);
if (counter != keySet.size()) {
System.out.print(", ");
}
}
System.out.println();
}
public static void exit(String[] args) throws Exception {
if (args.length != 1) {
throw new IllegalArgumentException("exit: " + INVALID_NUMBER_OF_ARGUMENTS_MESSAGE);
}
putFile();
System.exit(0);
}
}
|
[
"salnikov.dmitri@gmail.com"
] |
salnikov.dmitri@gmail.com
|
547c1b993ff7f01f8f8f6d5b7301325ba5a4217b
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/18/18_efd27b0bb09e383fefe61bf9aff65273eed65864/MainActivity/18_efd27b0bb09e383fefe61bf9aff65273eed65864_MainActivity_t.java
|
d1022a762886369cee3c20d5102493365cbc4b3f
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 5,234
|
java
|
/*
* Copyright (C) 2013 Sneaky Squid LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.sneakysquid.nova.app;
import android.app.Activity;
import android.hardware.Camera;
import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;
import com.sneakysquid.nova.link.NovaFlashCommand;
import com.sneakysquid.nova.link.NovaLink;
import com.sneakysquid.nova.link.NovaLinkStatus;
import com.sneakysquid.nova.link.NovaLinkStatusCallback;
import com.sneakysquid.nova.link.android.AndroidBleNovaLink;
import static com.sneakysquid.nova.util.Debug.assertOnUiThread;
import static com.sneakysquid.nova.util.Debug.debug;
/**
* @author Joe Walnes
*/
public class MainActivity extends Activity implements NovaLinkStatusCallback {
protected ErrorReporter errorReporter;
protected Camera camera; // May be null
protected CameraPreview preview;
protected PhotoSaver photoSaver;
protected NovaLink novaLink;
@Override
public void onCreate(Bundle savedInstanceState) {
debug("onCreate()");
super.onCreate(savedInstanceState);
errorReporter = new ModalErrorReporter();
photoSaver = new PhotoSaver(errorReporter);
preview = new CameraPreview(this, errorReporter);
novaLink = new AndroidBleNovaLink(this);
novaLink.registerStatusCallback(this);
errorReporter.reportError("Application started");
wireUpUi();
}
protected void wireUpUi() {
setContentView(R.layout.activity_main);
((FrameLayout) findViewById(R.id.camera_preview)).addView(preview);
(findViewById(R.id.button_capture)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onCameraButtonClick();
}
});
}
@Override
protected void onResume() {
debug("onResume()");
super.onResume();
camera = Camera.open();
if (camera == null) {
debug("No back facing camera, try any");
int numCameras = Camera.getNumberOfCameras();
if (numCameras > 0)
camera = Camera.open(0);
}
if (camera == null) {
errorReporter.reportError("Camera not found");
} else {
configureCamera(camera);
preview.beginPreview(camera);
}
novaLink.enable();
}
@Override
protected void onPause() {
debug("onPause()");
super.onPause();
preview.endPreview();
if (camera != null) {
camera.release();
camera = null;
}
novaLink.disable();
}
protected void configureCamera(Camera camera) {
Camera.Parameters parameters = camera.getParameters();
for (String focusMode: parameters.getSupportedFocusModes())
if (focusMode.equals(Camera.Parameters.FOCUS_MODE_AUTO))
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO);
camera.setParameters(parameters);
}
public void onCameraButtonClick() {
debug("onCameraButtonClick()");
if (camera == null) {
errorReporter.reportError("Camera not found");
} else {
NovaFlashCommand flashCmd = flashCommand();
// Take photo
Runnable takePhoto = takePhotoCommand(flashCmd, new TakePhoto.Callback() {
@Override
public void onPhotoTaken(byte[] jpeg) {
debug("onPhotoTaken()");
assertOnUiThread();
// When finished...
// Save
photoSaver.save(jpeg);
// Resume preview
if (camera != null) {
preview.beginPreview(camera);
}
}
});
takePhoto.run();
}
}
protected NovaFlashCommand flashCommand() {
return new NovaFlashCommand(255, 255, 500); // TODO: Values from UI
}
protected TakePhoto takePhotoCommand(NovaFlashCommand flashCmd, TakePhoto.Callback result) {
return new TakePhoto(this, camera, novaLink, flashCmd, result);
}
@Override
public void onNovaLinkStatusChange(NovaLinkStatus status) {
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
// // Inflate the menu; this adds items to the action bar if it is present.
// getMenuInflater().inflate(R.menu.main, menu);
// return true;
// }
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
bff60a06114e66f8d57b0402fa2e30361856943c
|
2e9fc2a03dcd933e638fb6cb4ea9fb01c0a42433
|
/src/main/java/com/latmod/mods/projectex/gui/GuiAlchemyTable.java
|
5ce31e560b43c5be472a9bc8bff2ab74026feab8
|
[] |
no_license
|
nnoble/Project-EX
|
20ff40f8af71b954a16a165fda3fea9eb20cb445
|
884d3ccdc35c2682f23247373e7e47fbace81006
|
refs/heads/master
| 2022-11-20T23:29:38.685054
| 2020-07-25T08:17:15
| 2020-07-25T08:17:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,744
|
java
|
package com.latmod.mods.projectex.gui;
import com.latmod.mods.projectex.ProjectEX;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
/**
* @author LatvianModder
*/
public class GuiAlchemyTable extends GuiContainer
{
private static final ResourceLocation TEXTURE = new ResourceLocation(ProjectEX.MOD_ID, "textures/gui/alchemy_table.png");
public final ContainerAlchemyTable container;
public GuiAlchemyTable(ContainerAlchemyTable c)
{
super(c);
container = c;
}
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
drawDefaultBackground();
super.drawScreen(mouseX, mouseY, partialTicks);
renderHoveredToolTip(mouseX, mouseY);
}
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
GlStateManager.color(1F, 1F, 1F, 1F);
mc.getTextureManager().bindTexture(TEXTURE);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if (container.emc > 0)
{
drawTexturedModalRect(guiLeft + 77, guiTop + 34, 177, 17, Math.max(1, (int) (container.emc / 255F * 24F)), 18);
}
if (container.progress > 0)
{
drawTexturedModalRect(guiLeft + 78, guiTop + 35, 177, 0, Math.max(1, (int) (container.progress / 255F * 22F)), 16);
}
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
{
//String s = this.tileFurnace.getDisplayName().getUnformattedText();
//this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 6, 4210752);
//this.fontRenderer.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752);
}
}
|
[
"latvianmodder@gmail.com"
] |
latvianmodder@gmail.com
|
4becee3249bf9bab513490b283ebb7169d6cf671
|
b733c258761e7d91a7ef0e15ca0e01427618dc33
|
/cards/src/main/java/org/rnd/jmagic/cards/Sporogenesis.java
|
1aa90417f63aeca2fe0c84e3ffba82064409991a
|
[] |
no_license
|
jmagicdev/jmagic
|
d43aa3d2288f46a5fa950152486235614c6783e6
|
40e573f8e6d1cf42603fd05928f42e7080ce0f0d
|
refs/heads/master
| 2021-01-20T06:57:51.007411
| 2014-10-22T03:03:34
| 2014-10-22T03:03:34
| 9,589,102
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,566
|
java
|
package org.rnd.jmagic.cards;
import static org.rnd.jmagic.Convenience.*;
import org.rnd.jmagic.engine.*;
import org.rnd.jmagic.engine.generators.*;
import org.rnd.jmagic.engine.patterns.*;
@Name("Sporogenesis")
@Types({Type.ENCHANTMENT})
@ManaCost("3G")
@ColorIdentity({Color.GREEN})
public final class Sporogenesis extends Card
{
public static final class SporogenesisAbility0 extends EventTriggeredAbility
{
public SporogenesisAbility0(GameState state)
{
super(state, "At the beginning of your upkeep, you may put a fungus counter on target nontoken creature.");
this.addPattern(atTheBeginningOfYourUpkeep());
SetGenerator targetable = Intersect.instance(NonToken.instance(), CreaturePermanents.instance());
SetGenerator target = targetedBy(this.addTarget(targetable, "target nontoken creature"));
EventFactory putCounter = putCounters(1, Counter.CounterType.FUNGUS, target, "Put a fungus counter on target nontoken creature");
this.addEffect(youMay(putCounter, "You may put a fungus counter on target nontoken creature."));
}
}
public static final class SporogenesisAbility1 extends EventTriggeredAbility
{
public SporogenesisAbility1(GameState state)
{
super(state, "Whenever a creature with a fungus counter on it dies, put a 1/1 green Saproling creature token onto the battlefield for each fungus counter on that creature.");
SetGenerator moldyCreatures = Intersect.instance(CreaturePermanents.instance(), HasCounterOfType.instance(Counter.CounterType.FUNGUS));
SimpleZoneChangePattern pattern = new SimpleZoneChangePattern(Battlefield.instance(), GraveyardOf.instance(Players.instance()), moldyCreatures, true);
this.addPattern(pattern);
SetGenerator thatCreature = OldObjectOf.instance(TriggerZoneChange.instance(This.instance()));
SetGenerator number = Count.instance(CountersOn.instance(thatCreature, Counter.CounterType.FUNGUS));
CreateTokensFactory f = new CreateTokensFactory(number, numberGenerator(1), numberGenerator(1), "Put a 1/1 green Saproling creature token onto the battlefield for each fungus counter on that creature.");
f.setColors(Color.GREEN);
f.setSubTypes(SubType.SAPROLING);
this.addEffect(f.getEventFactory());
}
}
public static final class SporogenesisAbility2 extends EventTriggeredAbility
{
public SporogenesisAbility2(GameState state)
{
super(state, "When Sporogenesis leaves the battlefield, remove all fungus counters from all creatures.");
this.addPattern(whenThisLeavesTheBattlefield());
EventFactory remove = new EventFactory(EventType.REMOVE_ALL_COUNTERS, "Remove all fungus counters from all creatures.");
remove.parameters.put(EventType.Parameter.CAUSE, This.instance());
remove.parameters.put(EventType.Parameter.COUNTER, Identity.instance(Counter.CounterType.FUNGUS));
remove.parameters.put(EventType.Parameter.OBJECT, CreaturePermanents.instance());
this.addEffect(remove);
}
}
public Sporogenesis(GameState state)
{
super(state);
// At the beginning of your upkeep, you may put a fungus counter on
// target nontoken creature.
this.addAbility(new SporogenesisAbility0(state));
// Whenever a creature with a fungus counter on it is put into a
// graveyard from the battlefield, put a 1/1 green Saproling creature
// token onto the battlefield for each fungus counter on that creature.
this.addAbility(new SporogenesisAbility1(state));
// When Sporogenesis leaves the battlefield, remove all fungus counters
// from all creatures.
this.addAbility(new SporogenesisAbility2(state));
}
}
|
[
"robyter@gmail"
] |
robyter@gmail
|
1f44d791c4fa18f015580b2dfb91ea4a9efb3b21
|
dc9c7f90d19e664f9970f4623578570203f98399
|
/FuramaResort/src/manager/ManagerBooking.java
|
a77c9fc7fbb905912db3118af2b7a0d97802ba60
|
[] |
no_license
|
hauhp94/C0321G1_HuynhPhuocHau_Module2
|
427a6413316efc37306fb3f2d5e28bf6b14317ba
|
633dcb2a377a181cc76c906247c3a771ede04383
|
refs/heads/main
| 2023-06-01T01:06:47.598267
| 2021-06-07T03:21:13
| 2021-06-07T03:21:13
| 362,328,451
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,549
|
java
|
package manager;
import commons.FuncWriteAndRead;
import libs.Path;
import models.Customer;
import models.Services;
import java.util.List;
import java.util.Scanner;
public class ManagerBooking {
public static FuncWriteAndRead<Customer> funcWriteAndRead = new FuncWriteAndRead<>();
public static List<Customer> listBooking = funcWriteAndRead.readDataFromFile(Path.PATH_BOOKING_CSV);
public static List<Customer> customerList = funcWriteAndRead.readDataFromFile(Path.PATH_CUSTOMER_CSV);
public static void showCustomerBooking() {
System.out.println("Danh sách khách hàng và dịch vụ đang sử dụng tại Furama");
for (Customer customer : listBooking) {
System.out.println("Khách hàng: " + customer.getIdCustomer() + " Tên: " + customer.getCustomerName() + " Đã đặt service " + customer.getServiceOfCustomer().getId());
}
}
public static boolean searchServiceBooking(String idService) {
for (Customer customer : listBooking) {
if (customer.getServiceOfCustomer().getId().equals(idService)) {
return true;
}
}
return false;
}
// Mỗi dịch vụ chỉ được đặt bới 1 khách hàng, mỗi khách hàng có thể đặt nhiều dịch vụ
public static void addNewBooking() {
ManagerCustomer.showInformationCustomer();
FuncWriteAndRead<Services> funcWriteAndReadService = new FuncWriteAndRead<>();
Services servicesToBooking = null;
Customer customerToBooking = null;
Scanner scanner = new Scanner(System.in);
System.out.println("Chọn khách hàng để booking: ");
System.out.print("Nhập id khách hàng cần booking: ");
String idCustomerToBooking = scanner.nextLine();
while (!ManagerCustomer.isIdCustomerExists(idCustomerToBooking)) {
System.out.print("id không hợp lệ, nhập lại: ");
idCustomerToBooking = scanner.nextLine();
}
for (Customer customer : customerList) {
if (customer.getIdCustomer().equals(idCustomerToBooking)) {
customerToBooking = customer;
}
}
while (true) {
int choose;
while (true) {
try {
System.out.println("Chọn chức năng:\n" +
"1.\tBooking Villa\n" +
"2.\tBooking House\n" +
"3.\tBooking Room\n");
choose = Integer.parseInt(scanner.nextLine());
break;
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
switch (choose) {
case 1:
System.out.println("Danh sách villa: ");
List<Services> servicesListVilla = funcWriteAndReadService.readDataFromFile(Path.PATH_VILLA_CSV);
for (Services services : servicesListVilla) {
System.out.println(services.showInfor());
}
String idVillaBook;
boolean checkVilla = true;
while (checkVilla) {
System.out.println("Nhập id villa muốn đặt: ");
idVillaBook = scanner.nextLine();
while (true) {
if (searchServiceBooking(idVillaBook)) {
System.out.print("Villa này đã có người đặt, vui chọn chọn villa khác: ");
idVillaBook = scanner.nextLine();
} else {
break;
}
}
for (Services services : servicesListVilla) {
if (services.getId().equals(idVillaBook)) {
servicesToBooking = services;
checkVilla = false;
break;
}
}
}
break;
case 2:
System.out.println("Danh sách house: ");
List<Services> servicesListHouse = funcWriteAndReadService.readDataFromFile(Path.PATH_HOUSE_CSV);
for (Services servicesHouse : servicesListHouse) {
System.out.println(servicesHouse.showInfor());
}
String idHouseBook;
boolean checkHouse = true;
while (checkHouse) {
System.out.println("Nhập id house muốn đặt: ");
idHouseBook = scanner.nextLine();
while (true) {
if (searchServiceBooking(idHouseBook)) {
System.out.print("House này đã có người đặt, vui lòng chọn house khác: ");
idHouseBook = scanner.nextLine();
} else {
break;
}
}
for (Services servicesHouse : servicesListHouse) {
if (servicesHouse.getId().equals(idHouseBook)) {
servicesToBooking = servicesHouse;
checkHouse = false;
break;
}
}
}
break;
case 3:
System.out.println("Danh sách room: ");
List<Services> servicesListRoom = funcWriteAndReadService.readDataFromFile(Path.PATH_ROOM_CSV);
for (Services servicesRoom : servicesListRoom) {
System.out.println(servicesRoom.showInfor());
}
String idRoomBook = "";
boolean checkRoom = true;
while (checkRoom) {
System.out.println("Nhập id room muốn đặt: ");
idRoomBook = scanner.nextLine();
while (true) {
if (searchServiceBooking(idRoomBook)) {
System.out.print("Room này đã có người đặt, vui lòng chọn room khác: ");
idRoomBook = scanner.nextLine();
} else {
break;
}
}
for (Services servicesRoom : servicesListRoom) {
if (servicesRoom.getId().equals(idRoomBook)) {
servicesToBooking = servicesRoom;
checkRoom = false;
break;
}
}
}
break;
default:
System.out.println("Nhập lại");
}
customerToBooking.setServiceOfCustomer(servicesToBooking);
listBooking.add(customerToBooking);
funcWriteAndRead.writeToFile(Path.PATH_BOOKING_CSV, listBooking);
System.out.println("Booking thành công");
return;
}
}
}
|
[
"hauhpdn2015@gmail.com"
] |
hauhpdn2015@gmail.com
|
06e34fcecbe720976db6cddd1568c64ef2b6e016
|
dd70bacf12f2b3fd81e4dac135b9a4e491f73cb8
|
/net/minecraft/entity/EntityInteraction.java
|
7e165ff262262b35ac47d27802974eafdaec088f
|
[] |
no_license
|
dennisvoliver/minecraft
|
bd9d8e256778ac3d00c1ab61a2b6c4702ed56827
|
fbf6271791785db06a3f8fe4a86c6a92f6a8d951
|
refs/heads/main
| 2023-04-23T12:38:25.848640
| 2021-05-19T07:15:38
| 2021-05-19T07:15:38
| 368,775,994
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 562
|
java
|
package net.minecraft.entity;
public interface EntityInteraction {
EntityInteraction ZOMBIE_VILLAGER_CURED = create("zombie_villager_cured");
EntityInteraction GOLEM_KILLED = create("golem_killed");
EntityInteraction VILLAGER_HURT = create("villager_hurt");
EntityInteraction VILLAGER_KILLED = create("villager_killed");
EntityInteraction TRADE = create("trade");
static EntityInteraction create(final String key) {
return new EntityInteraction() {
public String toString() {
return key;
}
};
}
}
|
[
"user@email.com"
] |
user@email.com
|
95a363572e61555a7255b9d4ee70b27e47144c80
|
c992cc664787167313fb4d317f172e8b057b1f5b
|
/modules/ui/src/main/java/io/jmix/ui/components/data/aggregation/Aggregations.java
|
7219568e2cce6e687a765f0301342682f33903ee
|
[
"Apache-2.0"
] |
permissive
|
alexbudarov/jmix
|
42628ce00a2a67bac7f4113a7e642d5a67c38197
|
23272dc3d6cb1f1a9826edbe888b3c993ab22d85
|
refs/heads/master
| 2020-12-19T15:57:38.886284
| 2020-01-23T10:06:16
| 2020-01-23T10:06:16
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,431
|
java
|
/*
* Copyright 2019 Haulmont.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.jmix.ui.components.data.aggregation;
import io.jmix.core.metamodel.datatypes.Datatype;
import io.jmix.core.metamodel.datatypes.Datatypes;
import io.jmix.ui.components.data.aggregation.impl.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
// vaadin8 convert to bean
public class Aggregations {
private static final Aggregations instance;
static {
instance = new Aggregations();
instance.register(Datatypes.getNN(BigDecimal.class), new BigDecimalAggregation());
instance.register(Datatypes.getNN(Integer.class), new LongAggregation());
instance.register(Datatypes.getNN(Long.class), new LongAggregation());
instance.register(Datatypes.getNN(Double.class), new DoubleAggregation());
instance.register(Datatypes.getNN(Date.class), new DateAggregation());
instance.register(Datatypes.getNN(Boolean.class), new BasicAggregation<>(Boolean.class));
instance.register(Datatypes.getNN(byte[].class), new BasicAggregation<>(byte[].class));
instance.register(Datatypes.getNN(String.class), new BasicAggregation<>(String.class));
instance.register(Datatypes.getNN(UUID.class), new BasicAggregation<>(UUID.class));
}
public static Aggregations getInstance() {
return instance;
}
private Map<Class, Aggregation> aggregationByDatatype;
private Aggregations() {
aggregationByDatatype = new HashMap<>();
}
protected <T> void register(Datatype datatype, Aggregation<T> aggregation) {
aggregationByDatatype.put(datatype.getJavaClass(), aggregation);
}
@SuppressWarnings("unchecked")
public static <T> Aggregation<T> get(Class<T> clazz) {
return getInstance().aggregationByDatatype.get(clazz);
}
}
|
[
"minaev@haulmont.com"
] |
minaev@haulmont.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.