method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
5169cd59-d09a-4a14-993c-b0a520e0e4d4 | 6 | private static void verifySourceCodeFileHasCorrectPackageName(File source,
PackDetails packDetails) throws IOException {
final String requiredPackage = "package " + packDetails.PackageName + ";";
System.out.println("Verifying source file " + source + " for package name validity ("
... |
d6cf6335-564d-4844-b0f2-574fb0a31bd0 | 3 | private void fight(int number){
if (hasEnemyInAreaToFight(number)){
int numberOfEnemies = numberOfEnemiesToFight(number);
if (beings.get(number).isZombie() && random() / numberOfEnemies < PROBABILITY_OF_ZOMBIE_TO_DIE) {
turnToDeadMan(number);
}else{
... |
e00a2b91-2f6c-4a59-8a57-b214206df275 | 6 | @Override
public void executeSqlQuery(String path, String query, List<Variable> queryParameters){
File f;
try {
f = FileWriterImpl.getInstace().fileCreate(path);
} catch (IOException ex) {
Logger.getLogger(PHPGenericWriterImpl.class.getName()).log(Level.SEVERE, null,... |
1523f7dd-b196-437d-94d3-dd0bc2dcef5e | 1 | @Override
public Boolean compareAnswer(Object input) {
if (!(input instanceof String)) return false;
String inputStr = (String) input;
return inputStr.trim().compareToIgnoreCase(answer.trim())==0;
} |
0706cf7b-23a0-45e6-a9a4-c9242e81f614 | 1 | private void btnEditarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditarActionPerformed
if(tablaProd.getSelectedRow()==-1){
JOptionPane.showMessageDialog(null, "No hay cliente seleccionado.");
}else{
p = productos.get(tablaProd.getSelectedRow());
... |
4ee35b15-3c91-411a-b161-d6317427f7b1 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final LogMultipleRecord other = (LogMultipleRecord) obj;
if (logData == null) {
... |
4e02770d-42d1-4d76-8ca4-d58d2b907a48 | 1 | private void variableDeclaration()
{
if (accept(NonTerminal.VARIABLE_DECLARATION))
{
tryDeclareSymbol(current);
expect(Token.Kind.IDENTIFIER);
expect(Token.Kind.COLON);
type();
expect(Token.Kind.SEMICOLON);
}
} |
057b1dba-fbb8-4c3f-9c4f-941f0dbf2740 | 1 | public void visit_if_icmpge(final Instruction inst) {
stackHeight -= 2;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
} |
9ad4fd56-024c-4251-906f-65186e20931d | 1 | @Override
public String toString() {
StringBuilder builder = new StringBuilder();
for (E element : elements) builder.append(element.toString());
return builder.toString();
} |
c25c9fda-db78-4ff7-9ba5-dc11546be79d | 7 | public static void startupJustifications() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/LOGIC", Stella.$STARTUP_TIME_PHASE$ > 1));
Native.setSpecial(Stella.$CONTEXT$,... |
2cec497c-4d07-4594-b3db-f8e8351c50db | 4 | public void dispose() {
if (paintSurface != null) paintSurface.dispose();
if (paintColors != null) {
for (int i = 0; i < paintColors.length; ++i) {
final Color color = paintColors[i];
if (color != null) color.dispose();
}
}
paintDefaultFont = null;
paintColors = null;
paintSurface = null;
... |
833c35d5-7ff6-4a01-a071-d46a1dc5b46c | 6 | private void toteutaFysiikka() {
if (lukitse && palikallaOnAlusta) {
lukitsePalikka();
} else if (aikayksikko < 0 && !palikallaOnAlusta) {
pudotaPalikkaaNegAikayksikko();
} else if (pudota) {
if (!palikallaOnAlusta) {
nykyinenPalikka.liiku(0, 1... |
14b190b3-e24f-46c2-9673-6db7a9b5ea5b | 2 | public void setCrawlStyle(int crawlStyle) {
if ((crawlStyle == DEPTH_FIRST) || (crawlStyle == BREADTH_FIRST)) {
this.crawlStyle = crawlStyle;
} else {
// Invalid Setting so make no changes
}
} |
f0e70ad2-a29d-4e84-bead-3d418e9322f8 | 2 | public boolean addSong(Song song) {
if(song.getAlbumName() == null) {
song.setAlbumName("No Album Name");
}
if(hasAlbum(song.getAlbumName())) {
// System.out.println("Artist named: " + name + " has album " + song.getAlbumName() + ", adding track named: " + song.getTitle() + "...");
Album tmpAlbum = album... |
caed833f-694b-415f-b904-d5e5b019b315 | 9 | public void run() {
Selector selector = DatagramConnectorDelegate.this.selector;
for (;;) {
try {
int nKeys = selector.select();
registerNew();
doUpdateTrafficMask();
if (nKeys > 0) {
... |
69ea17af-d699-4ba7-a696-bed13eca7524 | 5 | void cosqb1(int n, double x[], double wtable[])
{
int modn, i, k;
int kc, ns2;
double xim1;
ns2=(n+1)/ 2;
for(i=2; i<n; i+=2)
{
xim1=x[i-1]+x[i];
x[i]-=x[i-1];
x[i-1]=xim1;
}
x[0]+=x[0];
modn=n%2;
... |
60ac3d42-9be8-4b7a-9784-4c30a2b8b722 | 6 | private static void serviceRegistration() {
final ORB orb = injector_.getInstance(LocalPeerContext.class).getCorba();
try {
POA rootPOA = null;
try {
rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
} catch (InvalidName invalidNa... |
65d93cef-6968-4168-82e6-3e4c57b5b013 | 7 | @Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PObject pObject = (PObject) o;
if (object != null ? !object.equals(pObject.object) : pObject.object != ... |
41dfbc38-f602-4b8c-aa6d-c03dfd7ce93c | 5 | private void rotateLeft(Node u)
{
int hookType;
if (root == u) hookType = 0;
else if (u == u.parent.left) hookType = -1;
else hookType = 1;
Node nodesRight = u.right;
Node rightsLeft = nodesRight.left;
nodesRight.left = u;
if (hookType == 0) r... |
7862a8a1-2325-4112-9c9e-d9efea57d435 | 2 | public static void main(String[] args) throws Exception {
InputStream inputStream = Mirror.class.getResourceAsStream("D-small-practice.in");
InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
BufferedReader bf = new BufferedReader(inputStreamReader);
int cases = Integer.parseInt(bf.readLi... |
1163a724-6824-43af-af7d-d83415f8c804 | 5 | private static void appendJSONPair(StringBuilder json, String key, String value) throws UnsupportedEncodingException {
boolean isValueNumeric = false;
try {
if (value.equals("0") || !value.endsWith("0")) {
Double.parseDouble(value);
isValueNumeric = true;
... |
a8c66274-08b8-46f5-b2cf-05de40df9d03 | 4 | public Paddle(int xInitial, int yInitial) throws IllegalArgumentException{
// Check to see if the x-axis position is within bounds.
if (xInitial >= PADDLE_MIN_X && xInitial <= PADDLE_MAX_X) {
xPosition = xInitial;
} else {
throw new IllegalArgumentException("Initial horizontal position out of bounds.");
... |
ee005053-19c0-42ae-adf4-2018f1d37601 | 9 | public ManagerInterface(String username, ConnectionHandler conn)
{
custConn = conn;
System.out.println("Welcome to eMART!");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String command = null;
boolean continueAccess = true;
while (continueAccess == true)
{
System.ou... |
75a1d5d9-61e2-4f91-b29a-08a972acfdd7 | 3 | public ArrayList<Cliente> selectAllCliente(){
ArrayList<Cliente> clientes = new ArrayList<Cliente>();
try {
Statement comando=connection.createStatement();
ResultSet registro = comando.executeQuery("select * from Cliente");
boolean especial = false;
while (... |
1110353c-808d-43cb-b363-cb5c72b7ca6a | 3 | private Position getRandomMove(TicTacToeBoard state) {
ArrayList<Position> availableMoves = new ArrayList<Position>();
for( int row = 0; row < TicTacToeBoard.SIZE; row++ ) {
for( int col = 0; col < TicTacToeBoard.SIZE; col++ ) {
if( state.getState(row,col) == TicTacToeBoard.BLANK ) {
availableMoves.add(... |
f5529c70-ae93-436a-ae66-1a1d5a202031 | 2 | public void type(KeyEvent ev) {
setmods(ev);
if (keygrab == null) {
if (!root.type(ev.getKeyChar(), ev))
root.globtype(ev.getKeyChar(), ev);
} else {
keygrab.type(ev.getKeyChar(), ev);
}
} |
dbd17ca8-bcd3-44a6-909e-59f2786305de | 8 | private boolean compareContentFile(File first, File second) {
int size = 1024;
if (first.length() < size) size = (int)first.length();
byte firstArray[] = new byte[size];
byte secondArray[] = new byte[size];
try{
InputStream isFirst = new FileInputStream(first);
InputStream isSecond = new FileInputStr... |
9345f775-8686-429f-a596-ccafb98af3a1 | 4 | private int getOnlinePlayers() {
try {
Method onlinePlayerMethod = Server.class.getMethod("getOnlinePlayers");
if(onlinePlayerMethod.getReturnType().equals(Collection.class)) {
return ((Collection<?>)onlinePlayerMethod.invoke(Bukkit.getServer())).size();
} els... |
8dbcda05-ead3-4b6a-b448-3b6e8502ec08 | 5 | protected List<Rule> expandDefeasibleRule(final Rule rule) throws RuleException {
if (rule.getRuleType() != RuleType.DEFEASIBLE) return null;
String originalRuleLabel=rule.getOriginalLabel();
List<Rule> newRules = new ArrayList<Rule>();
List<Literal> headLiterals = rule.getHeadLiterals();
try {
if (headLi... |
6123dc78-4046-4577-8851-a4e8068d96e6 | 4 | public void decreaseKey(FibonacciHeapNode x, double k)
{
if (k > x.key) {
return;
// throw new IllegalArgumentException(
// "decreaseKey() got larger key value");
}
x.key = k;
FibonacciHeapNode y = x.parent;
if ((y != null) && (x.key < y.key)) {
cut(x, y);
cascadingCut(y);
}
if (x.key < minNode.key) {
minNode = x;
... |
0eda409b-84a6-45d0-8a7d-d0889986723f | 1 | private void setupNoRandPartA() throws IOException {
if (this.su_i2 <= this.last) {
this.su_chPrev = this.su_ch2;
int su_ch2Shadow = this.data.ll8[this.su_tPos] & 0xff;
this.su_ch2 = su_ch2Shadow;
this.su_tPos = this.data.tt[this.su_tPos];
this.su_i2++... |
6a34448d-216d-4894-a6d9-44bbe0de58f1 | 2 | public RoleSchool getRole(int roleId) {
for (RoleSchool role : roles) {
if (role.getId() == roleId) {
return role;
}
}
return null;
} |
e33e5f4a-32ad-46db-bd1b-555a9f90a1b1 | 4 | private boolean isAlternateWords( String word ) {
String[] words = word.split( "/" );
if( words.length > 1 ) {
for( String w : words ){
if( !isValidWord( w )){
return false;
}
}
for( String w : words ){
... |
40bdf552-c67a-4929-a623-665b80fdd99d | 7 | public boolean isSystemPath(String name)
{
name=name.replace('/','.');
while(name.startsWith("."))
name=name.substring(1);
String[] system_classes=_context.getSystemClasses();
if (system_classes!=null)
{
for (int i=0;i<system_classes.length;i++)
... |
e2e056ba-b0da-4da8-9fa3-3c04556a7d29 | 3 | public void validate() {
if (personBean.getFirstName().length() == 0) {
addFieldError("personBean.firstName", "First name is required.");
}
if (personBean.getEmail().length() == 0) {
addFieldError("personBean.email", "Email is required.");
}
if (personBean.getAge() < 18) {
addFieldError("personBea... |
267ca3ef-c4e2-4d62-8a98-f0c1f8c70525 | 1 | private Font createFont(String name, float size) {
Font font = null;
InputStream fontStream = Main.class.getResourceAsStream("/font/" + name);
try {
font = Font.createFont(Font.TRUETYPE_FONT, fontStream);
font = font.deriveFont(size);
} ca... |
e80a5813-8c37-4fcb-b807-7c841d2d500b | 6 | public static void main(String args[] ) throws Exception {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
ArrayList arrList=new ArrayList();
int sizeOfAP=0;
int sum=0;
int diff=0;
int expectSum=0;
Scanner sc=new Scanner(System.in);
... |
107c1203-bd20-4745-a508-3039b9d8992d | 2 | static String formatVersion(String version) {
String result = "";
result = (version.startsWith("v") || version.startsWith("V")) ? version.substring(1, version.length()) : version;
return result.trim();
} |
e44049ba-9ddd-441a-9046-5980b5f9c957 | 8 | public static void qsHelpQuant( int lo, int hi, LinkedList<StockPosition> d ) {
if ( lo >= hi )
return;
int tmpLo = lo;
int tmpHi = hi;
int pivot = d.get(lo).getNumShares();
StockPosition pivotStock = d.get(lo);
while( tmpLo < tmpHi ) {
//first, slide markers in as far as possible without swaps
... |
1326b89a-f6df-415d-a9fd-2911efb9da89 | 7 | private List<Achievement> getLowestNumberedTattoos(final Agent agent, final Set<String> WonList)
{
List<Achievement> useList = new LinkedList<Achievement>();
HashSet<String> ignoredStarters = new HashSet<String>();
for(Enumeration<Achievement> a=CMLib.achievements().achievements(agent);a.hasMoreElements();)
{
... |
43cba036-6056-490c-9ae1-ee8adb6d69b9 | 9 | private String getIpAddr(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
ip = request.getHeader("Proxy-Client-IP");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(i... |
679695b1-7caa-43cf-acf7-f892d9b65642 | 0 | public ExceptionPane(){
super();
this.setLayout(new BorderLayout());
ext = new JTable(result,object);
firsPanel.add(dateLabel);
firsPanel.add(Jdate);
JScrollPane scrollPane = new JScrollPane(ext);
this.add(firsPanel,BorderLayout.NORTH);
this.add(scrollPane... |
3b2ce116-fed5-47e7-ba39-d59ec549e6fa | 4 | public String getClipboardData() {
Transferable clip = null;
try {
Clipboard cp = Toolkit.getDefaultToolkit().getSystemClipboard();
clip = cp.getContents(this);
}
catch (Exception e) {
}
if (clip == null) {
return "";
... |
18449ac8-1102-4125-a48b-de966e985750 | 7 | public void calculateFinalResult() {
do {
iStage++;
compAllocation();
if (compDistribution()) {
/* deadline can not be satisfied */
if (!bDeadline) {
System.out.println("CostMinMin2: THE DEADLINE CAN NOT BE SATISFIED!");
return;
} else {
println("\nNEW ROUND WITHOUT CHECKING:");
... |
52bf930e-6f06-44ea-8fe5-c679441b1bea | 6 | public List <CompareItem> compare(List <ConfigParam> original, List <ConfigParam> source){
List <CompareItem> items = new ArrayList<CompareItem> ();
for(int i=0; i < original.size(); i++){
ConfigParam orig = original.get(i);
if(source.contains(orig)){
ConfigParam src = source.get(source.indexOf(orig));... |
0ff12688-3c1d-4dbf-bb15-fe2cb5467378 | 1 | protected void changedStatus(){
for(ModelChangeListener mcl : listeners){
mcl.changedStatus(serv_enabled,client_connected);
}
} |
ad27aa49-115b-4d28-bbf8-b9421a262329 | 5 | public int hgetbits(int N)
{
totbit += N;
int val = 0;
int pos = buf_byte_idx;
if (pos+N < BUFSIZE)
{
while (N-- > 0)
{
val <<= 1;
val |= ((buf[pos++]!=0) ? 1 : 0);
}
}
else
{
while (N-- > 0)
{
val <<= 1;
val |= ((buf[pos]!=0) ? 1 : 0);
pos = (pos+1) & BU... |
13c9a581-84f9-49dc-bcad-c10c38b5bce7 | 8 | public boolean click(Level level, Sprite sprite, int x, int y, int button)
{
//sprites.sprites.clear();
//sprites.sprites.add(new Sprite(0, 0, 0, Art.gemSlot));
if (placedItem != null)
{
if (level.player.carried == null)
{
System.out.println("taking item");
level.player.c... |
6c134fc6-43ad-4d83-97f9-79fbfc9ef58f | 5 | private boolean hasMissingParameters(RegRequest request, RegResult result) {
// Some values that should always be sent
if (StringUtils.isEmpty(request.getUsername())) {
result.addMissingParameter(RegRequest.KEY_USERNAME);
}
if (StringUtils.isEmpty(request.getPassword())) {
result.addMissingParameter(RegRe... |
7f122593-7ab6-48c4-a0f5-d31660e0b97e | 9 | private void method38() {
for (int i = -1; i < localPlayerCount; i++) {
int j;
if (i == -1) {
j = myPlayerIndex;
} else {
j = playerIndices[i];
}
Player player = localPlayers[j];
if (player != null && player.... |
bf19f357-3625-42ae-a622-01ae368413ad | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ExtractedSMS other = (ExtractedSMS) obj;
if (message == null) {
if (other.message != null)
return false;
} else if (!message... |
8b0a1d18-4880-461e-b3c2-ae955ac7713b | 1 | public ResultSet getList(String whereString){
StringBuffer sql=new StringBuffer("");
sql.append("SELECT MCQOption_ID,Question_ID,Content,isAnswerOrNot");
sql.append(" FROM `MCQOption`");
if (whereString.trim()!="") {
sql.append(" where "+whereString);
}
... |
5881c9fc-d530-4d6b-986c-2f03b3fe1ce3 | 0 | public Question()
{
} |
80293961-0945-46b1-ab2d-da7c65b3b455 | 2 | public static double getDoubleValue(String value) {
if(value != null) {
try {
return Double.parseDouble(value);
} catch(NumberFormatException exception) {}
}
throw new IllegalArgumentException("Invalid value");
} |
b2856459-1509-4534-bed5-5b0f713d0c53 | 3 | void begin() {
while(true){
if(toDo.isEmpty() == true){
// toDo.add(new DefaultState(as));
toDo.addAll(done);
//toDo.add(new DefaultState(as));
done.clear();
}
else{
toDo.peek().show();
Event event = toDo.poll();
//done.offer(event);
//use event to call next
Event... |
5481d69b-b471-48ba-ad0e-48de7b20e730 | 7 | private synchronized void manageWishes()
{
IMarketCommunicator buyer = null;
boolean any = false;
ArrayList<Item> newsWishes = new ArrayList<Item>();
for (int i = 0; i < wishes.size(); ++i)
{
Item wish = wishes.get(i);
newsWishes.add(wish);
... |
b2b0dc90-4385-4f4e-bd12-9cab10a2b325 | 1 | public Integer obtenerStockDisponible(String producto){
if(!this.stock.containsKey(producto)){
return null;
}
return this.stock.get(producto);
} |
6bcd2071-a059-41f9-bdb2-a35372a24c6b | 7 | private void setDisplayGrade()
{
String s = "";
if (this.getGrade().equalsIgnoreCase("PK"))
s = "PK";
else if (this.getGrade().equalsIgnoreCase("KK"))
s = "K";
else if (this.getGrade().equalsIgnoreCase("01"))
s = "1st";
else if (this.getGrade().equalsIgnoreCase("02"))
s = "2nd";
else if (th... |
3b756d9e-d975-4af8-81d3-1668c369b2eb | 4 | public CompetitionManager(Team[] teams, Event[] events) {
for (int i = 0; i < teams.length; i++) {
if (teams[i] == null) {
} else {
teamList.Add(null, teams[i], null);
}
}
for (int i = 0; i < events.length; i++) {
if (events[i] == null) {
} else {
eventList.Add(null, null, events[i]);
... |
aacfb1be-7cf4-405b-aaef-7c8add8104be | 8 | public boolean f(int i, int j) {
String key = i + "," + j;
Boolean result = m.get(key);
if (result == null) {
if (i==0) {
result = j==0;
} else if (j==0) {
result = p.charAt(i-1)=='*' && f(i-1, 0);
} else {
char ... |
ccb1dbe6-9319-40cb-b383-8d1f73b09120 | 5 | static Path convertToBMP(Path imagepath, Path destination, String newName) throws IOException, InterruptedException {
if (!FileUtil.control(imagepath) || (destination == null)) {
throw new IllegalArgumentException();
}
Path ret;
if (!imagepath.getFileName().toString().endsWi... |
de659687-4489-478c-9ed3-7cb0be6ff78f | 3 | protected boolean isTokenValid(HttpServletRequest
request) {
HttpSession session = request.getSession(false);
if (session == null) {
return false;
}
String saved = (String)
session.getAttribute(ApplictionResources.getTransactionTokenKey());
if (save... |
afad0166-c006-4dc5-b650-d8c554a4fc22 | 1 | public void draw(Graphics2D g, int x, int y, ItemStack stack){
g.drawImage(texture, x, y, 16, 16, null);
g.setFont(font);
if(stack.stackSize < 10)
{
g.setColor(Color.DARK_GRAY);
g.drawString(stack.stackSize+"", x+11, y+17);
g.setColor(Color.white);
g.drawString(stack.stackSize+"", x+10, y+16);
}... |
34f6511c-1baa-4509-bed4-f4aacf6b315c | 2 | @Override
public String toString() {
String resp = "";
for (int i = 0; i < getWidth(); i++) {
resp += "\n";
for (int j = 0; j < getHeight(); j++) {
resp += values[i][j] + " | ";
}
}
return resp;
} |
3d0fd5c0-f37d-4c8f-9f4d-05d95baf4e57 | 8 | public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
if(cmd.getName().equalsIgnoreCase("fly")){
if(!(sender instanceof Player)){
sender.sendMessage("This is a player command.");
}
if(sender instanceof Player){
if(sender.hasPermission("ArcadeEss.fly")){
if(args.length... |
a888f5bd-8bee-428b-9d0f-c3af4941b95a | 6 | private static int SPRToInt(String str) {
if (str.equals("POP")) {
return 0x18;
} else if (str.equals("PEEK")) {
return 0x19;
} else if (str.equals("PUSH")) {
return 0x1a;
} else if (str.equals("SP")) {
return 0x1b;
} else if (str.equals("PC")) {
return 0x1c;
} else if (str.equals("O")) {
... |
2b5bfd6e-c805-4c36-9709-f51f96663b0d | 0 | public boolean isEmpty() {
return (size == 0);
} |
03a7285c-d8c2-43ff-9933-964e09ad5f51 | 5 | @Override
public void update(Observable ml, Object e) {
Warborn model = (Warborn)ml;
if(model.getState() == 2 && model.getPhase() == 1){
this.setVisible(true);
Battle battle = model.getBattle();
t1 = battle.getFirstTerritory();
t2 = battle.getSecondTerritory();
lbBattle.setText("Battle!");
btO... |
65b75550-722e-4f93-8239-b79e68344771 | 5 | @Override
public User findUserByUserId(int userId) {
User user = null;
Connection cn = null;
PreparedStatement ps = null;
ResultSet rs = null;
try {
cn = ConnectionHelper.getConnection();
ps = cn.prepareStatement(QTPL_SELECT_BY_USER_ID);
... |
3851ed27-22fc-458d-a810-ad2e8c83ee1b | 1 | @Override
public void run() {
garePresentationVoyageur.getEspaceVente().getGuichet(this);
Train trainReserve = garePresentationVoyageur.getServeurBilletterie().reserverTicket(this,garePresentationVoyageur);
System.out.println(""+getNom()+" j'ai acheté un billet");
if(trainReserve.g... |
0abda0ee-d22c-440b-a4db-50edab6336ce | 0 | public void setRole(String role) {
this.role = role;
} |
d47a8501-26e3-4233-963e-4485f4df728f | 3 | private void checkCorrectSet() {
for (int j = 0; j < nbRegister; j++) {
if (include(correct, writeSet[j])) {
if (reading[j]) {
reading[j] = false;
trigger(new ReadResponse(j,readVal[j]), ar);
} else {
trigger... |
20555143-5e5a-4992-a83b-c4b127fdc95e | 2 | public static String encode(Map<String, String> obj) {
StringBuilder str = new StringBuilder();
for (Map.Entry<String, String> entry : obj.entrySet()) {
if (str.length() > 0) str.append("&");
str.append(Global.encodeURIComponent(entry.getKey())).append("=")
.a... |
c35c646d-2c7f-4249-a3d7-e12341f81486 | 5 | private ArrayList<Language> sortProbability(double[] prob) {
ArrayList<Language> list = new ArrayList<Language>();
for(int j=0;j<prob.length;++j) {
double p = prob[j];
if (p > PROB_THRESHOLD) {
for (int i = 0; i <= list.size(); ++i) {
if (i == ... |
072c6f12-95bb-4e21-8b85-7eb477a33e0f | 0 | public PhpposCustomersEntity getCustomer(int idPeople){
return (PhpposCustomersEntity) getHibernateTemplate().get(PhpposCustomersEntity.class, idPeople);
} |
4d79e97e-ef11-4e20-9521-e8d56949c9ae | 1 | public void actionPerformed(ActionEvent arg0) {
if(game.isRunning()){
game.renew();
gc.inRepaint();
}
} |
10a0747d-38a5-4702-8907-ccd676b065ec | 0 | public void setOrginalId(UUID value) {
this._orignalId = value;
} |
5f942a2b-f92a-4d0c-a729-577193ae6058 | 7 | private static String getNumber(String text) {
int nombre = 0; // contient le nombre entré
String choix = ""; // contient le texte entré par l'utilisateur
do {
choix = JOptionPane.showInputDialog(text);
// s'assurer que la réponse entrée est correcte
if(c... |
40ca95d8-40e2-4572-b990-7e1547d108d6 | 0 | private void createDialog(String answ) {
final JDialog dialog = new JDialog();
dialog.setSize(460, 250);
dialog.setResizable(false);
dialog.getContentPane().setLayout(null);
dialog.setLocationRelativeTo(this);
dialog.setLayout(null);
JLabel lblAnswerLabel = new JLabel("Wprowadź odpowiedź");
lblAnswerL... |
7b45e3f6-8b71-467e-b0c6-8e51b5716302 | 4 | public static TransformGroup rotarEstatico(Node objeto, float grados, tipoTrans tipoRot) {
/* Transformacion a realizar sobre la esfera*/
Transform3D rotacion = new Transform3D();
//Datos de rotaci�n en X,Y,Z //Math.PI/4.0d);
rotacion.rotX(Math.toRadians(0));
try {
i... |
4c6e798d-66b4-4405-873a-b3100bf621ae | 9 | public SimpleList<String> mezquitaXMLStructure (){
try {
String path = new File(".").getCanonicalPath();
FileInputStream file =
new FileInputStream(new File(path
+ "/xml/papabuilding.xml"));
DocumentBuilderFactory builderFactory =
Document... |
4798cf51-3aca-4c34-beb4-61f54f29ad54 | 8 | public BottomMenuToolbarIcon(String text, Faction faction, boolean ally) {
String ext = "";
if (faction.equals(StaticData.federation)) {
ext = "_fed";
}
if (faction.equals(StaticData.klingon)) {
ext = "_kli";
}
if (faction.equals(StaticData.romulan... |
0994a441-e0c0-431f-8e92-534f64f9e930 | 4 | public void pieceMovedEvent(LOCATION from, LOCATION to) {
// Handle 'from' position
List<BoardFigure> list = figureMap.get(from);
// Defensive programming - check that the framework user
// has kept the invariant that there must be list
// of all possible from fields.
if (list == null) {
t... |
16da725a-89b7-41d0-8787-e4bf493c1b90 | 9 | private boolean isSettingsModified()
{
return !this.favouriteUser.getText().equals(Utils.config.getString(Configuration.FAVOURITEUSER, null)) || !(Utils.config.getBoolean(Configuration.SHOWNOTIFICATION, false) == this.notificationCheck.isSelected()) || !(Utils.config.getBoolean(Configuration.KEEPDATE, false) == this... |
fe65e707-10f7-419a-a95d-15b1a460baf7 | 0 | public void setManufacturer(String value) {
this.manufacturer = value;
} |
c1a69685-f482-42e5-be72-c7bdb1f64940 | 3 | private void handleAuthorizationResult(String controllerId, boolean result) {
Message msg = new Message(Message.Type.ACCESS_RSP, controllerId, Message.MANAGER);
msg.addData(Message.Field.ACCESS_RES, ""+result);
hydnaSvc.sendMessage(Serializer.serialize(msg));
if (result == true) {
AccessAssociation aa = find... |
5d791ca6-2b14-4047-980a-c0e437df7877 | 0 | private void setGpsQuest(FieldQuest quest, String x, String y,
String width, String height) {
quest.setXCoordinate(Double.parseDouble(x));
quest.setYCoordinate(Double.parseDouble(y));
quest.setX2Coordinate(Double.parseDouble(width));
quest.setY2Coordinate(Double.parseDouble(height));
quest.countDimmension(... |
3dc164d0-0f68-4ac9-b9ef-4823f8785181 | 5 | @EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
if(!Utils.cooldown.containsKey(player.getName())) {
Utils.cooldown.put(player.getName(), 0);
}
Utils.modes.put(player.getName(), "none");
Utils.confirmed.put(player.getName(), false);
io.loadMoney();
if(... |
4313092b-4ba9-4a0f-ad7e-0d590b89b995 | 9 | public List<Integer> encodeData(String data) {
wbEncoding = new HashMap<String, Integer>();
StringBuffer sb = new StringBuffer(data);
List<Integer> encoded = new LinkedList<Integer>();
int nextIndex = 256;
while (sb.length() > 0) {
int i = 1;
// char not available
if (wbEncoding.get(sb.substring... |
9f11d5c4-4db2-4147-a3bc-5baa2ca6fc24 | 7 | private void gestioSubmenu2Albums(Scanner sc, int choosenAlbum) {
// Creem l'objecte per al menú. Li passem com a primer paràmetre el nom del menú
Menu<OpcionsSubmenu_2_gestioAlbum> menu=new Menu<OpcionsSubmenu_2_gestioAlbum>("Menu Gestionar Album",OpcionsSubmenu_2_gestioAlbum.values());
// Ass... |
19365b69-c961-4996-805c-09f821f14d53 | 3 | @SuppressWarnings("unchecked")
@Override
public void processEntities() {
for (ValidableEntity employee : this.entityList.getEntityList()) {
Employee employeeObject = (Employee) employee;
LOG.info(StringUtil.concatenateStrings("About to process the entity - ", employeeObject.toString()));
if (validatorStore... |
6dc9c30e-1cb5-40b6-a880-bd525aeaae4c | 3 | public void newNPCList(int npcType, String npcName, int combat, int HP) {
// first, search for a free slot
int slot = -1;
for (int i = 0; i < maxListedNPCs; i++) {
if (NpcList[i] == null) {
slot = i;
break;
}
}
if(slot == -1) return; // no free slot found
NPCList newNPCList = new NPCList(np... |
ff5c66ea-38de-4e12-a98a-1ea672f03540 | 6 | private static void getAllPermutations(List<String[]> permutations, List<Specie> specieList, int nrOfVariables) {
Integer[] possible = new Integer[nrOfVariables];
Integer nrOfSpecies = specieList.size();
Integer index = 0;
Integer currentElement = 0;
possible[index] = initialize(index);
while (index >... |
7c106505-18b5-4fd9-9df6-775edf62cf43 | 9 | @Override
public void handle(Event event) {
logger.info("Processing an event: " + event.toString());
ServiceChangeEvent scEvent = (ServiceChangeEvent) event;
// SyncEvent syncEvent = (SyncEvent) event;
DynasoarService service = scEvent.getService();
String WARchecksum = null;
String Configchecksum = null;... |
ae6f1fae-b012-405b-a017-43daea66e309 | 5 | public void setTopic(String topic) {
this.topic = topic;
PoolConnection pcon = ConnectionPool.getConnection();
PreparedStatement ps = null;
try {
Connection con = pcon.connect();
ps = con.prepareStatement("UPDATE `channels` SET `topic` = ? WHERE `name` = ?");
ps.setString(1, topic);
ps.setString(2... |
7c8149e8-47f8-4d15-adf5-780094196fae | 9 | public boolean skipPast(String to) throws JSONException {
boolean b;
char c;
int i;
int j;
int offset = 0;
int n = to.length();
char[] circle = new char[n];
/*
* First fill the circle buffer with as many characters as are in the
* to string. If we... |
507832b9-5ecd-47b4-a324-effa1effda7b | 6 | public boolean isEntityOnBlock(final int x, final int y){
out = false;
Game.get().level.getEntitys().doForAll(new editAction<Entity>() { @Override public void action(Entity e) {
if(e.onGrid())
if(x == e.getX() && y == e.getY())
out = true;
if(!e.onGrid())
if(e.getX()/Game.get().ppb_x == x &&... |
3dae142d-2449-455c-acee-5f9219c33f99 | 8 | public void printAndVerifyAreaDependencyCheckResult(AreaDependencyCheck.AreaDependencyCheckResult dependencyCheckResult) {
final Map<ConfigurationArea, List<ConfigurationAreaDependency>> occuredOptionalErrors = dependencyCheckResult.getOptionalDependencyErrors();
if(occuredOptionalErrors.isEmpty() == false) {... |
23806f2d-3a69-4ff1-a8d8-a5a63c135442 | 1 | public boolean setTerrainResource(URL terrainSourceURL)
{
try
{
terrain = ImageIO.read(terrainSourceURL);
return true;
}
catch (Exception e)
{
e.printStackTrace();
return false;
}
} |
f9ed4bb6-92e3-4a33-8589-72da27af8561 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof Entry))
return false;
Entry other = (Entry) obj;
if (firstName == null) {
if (other.firstName != null)
return false;
} else if (!firstName.equals(other.firstName))... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.