method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
9693cedc-fede-4249-acf6-559f63a1e3a9 | 5 | public String makePayment(double paymentAmount) throws NegativePaymentAmountException {
if (paymentAmount < 0) {
throw new NegativePaymentAmountException();
} else if (paymentAmount == 0) {
return "Payment processed";
} else if (paymentAmount > 0 && paymentMethod == null)... |
030c864a-cef1-4a00-be65-da3fd91e60f7 | 4 | private void JBRemoverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBRemoverActionPerformed
this.zerarModelo();
int codigo;
try{
int index = JTListaConsultas.getSelectedRow();
if(index >= 0){
codigo = (int) JTListaConsultas.getV... |
13e0fabf-9a72-4b20-8c84-93cc1a4c8fe2 | 0 | public void setBlogContent(String blogContent) {
this.blogContent = blogContent;
} |
31b14986-d58c-4979-a195-fc7c252e2157 | 9 | public UndoableImageEdit(PaintBox box, int undoable) {
this.box = box;
String temp = null;
this.undoable = undoable;
if (box instanceof FTLRoom) {
temp = ((FTLRoom) box).interiorData.interiorPath;
old = temp != null ? new String(temp) : null;
} else if (box instanceof HullBox) {
if (undoable == Undo... |
dcfdd8cb-3bb3-4347-b2ed-822a3f2a4aa1 | 1 | public void testPlus_int() {
Months test2 = Months.months(2);
Months result = test2.plus(3);
assertEquals(2, test2.getMonths());
assertEquals(5, result.getMonths());
assertEquals(1, Months.ONE.plus(0).getMonths());
try {
Months.MAX_VALUE.plus... |
2c9154b0-9699-4fe3-b444-157eb8ce2b4c | 2 | public void loadTiles(String s) {
try {
tileset = ImageIO.read(getClass().getResourceAsStream(s));
numTilesAcross = tileset.getWidth() / tileSize;
tiles = new Tile[2][numTilesAcross];
BufferedImage subimage;
for (int col = 0; col < numTilesAcross; col++) {
subimage = tileset.getSubimage(col * t... |
d139adb7-9af0-432c-b2be-33943d6cd252 | 0 | public JCheckBoxMenuItem getTuringFinalCheckBox() {
return transTuringFinalCheckBox;
} |
b321d5f5-fce6-4a5c-b5ea-9cd4fefa4056 | 5 | @Override
public IEmailKontakt next(IEmailKontakt emailKontakt)
throws NoNextEmailKontaktFoundException {
EmailKontaktList emailContacts = readContacts();
if (emailContacts.getContactList().size() == 0) {
throw new NoNextEmailKontaktFoundException("Kein Kontakt gefunden!");
} else {
EmailKontakt ek = ne... |
271853a5-c524-4815-bba4-295d74365d20 | 8 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ArrayType other = (ArrayType) obj;
if (this.supportedSchemaTypes != other.supportedSchemaTypes && (this.s... |
544dc3d3-d50f-466f-b1de-fe7326b8370b | 0 | public String getSourceText()
{
return _sourceText;
} |
8e5d5203-a5b4-4870-80ce-7b0b10642997 | 7 | void extendToWholeWords() throws Exception
{
String[] mergedCells = getMergedCells();
for ( int i=0;i<rows.size();i++ )
{
Row r = rows.get(i);
for ( int j=0;j<r.cells.size();j++ )
{
FragList fl = r.cells.get(j);
if ( !fl.mer... |
5329cd39-262b-4282-b997-2258d57fb2a6 | 2 | @Override
public void acceptTrade(IPresenter presenter, boolean willAccept) {
MoveResponse response = presenter.getProxy().acceptTrade(presenter.getPlayerInfo().getIndex(), willAccept, presenter.getCookie());
if(response != null && response.isSuccessful()) {
presenter.updateServerModel(response.getGameModel(... |
1fa8e8f3-e235-4a3a-91e6-7de6235911e9 | 4 | static List <File> directoryFiles(String path, String extension) {
List <File> allFiles = new ArrayList <File> ();
allFiles.add(new File(path));
int index = 0;
while (index != allFiles.size()) {
File currentFile = allFiles.get(index);
if (currentFile.isDirectory()) {
allFiles.remove(index);
for (F... |
7df447e3-94f3-46ed-a7c7-4840ff6dba4f | 0 | public Controller(View v, Model m) {
_view = v;
_model = m;
v.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setChatButtonClick();
setReadyButtonClick();
} |
7c3da885-bc09-4ba4-9a63-ec0d9376f00c | 2 | public void back() throws JSONException {
if (this.usePrevious || this.index <= 0) {
throw new JSONException("Stepping back two steps is not supported");
}
this.index -= 1;
this.character -= 1;
this.usePrevious = true;
this.eof = false;
} |
5ef03340-2436-4572-b1ad-e85a6b3a8a66 | 4 | public static SelectItem[] getSelectItems(List<?> entities, boolean selectOne) {
int size = selectOne ? entities.size() + 1 : entities.size();
SelectItem[] items = new SelectItem[size];
int i = 0;
if (selectOne) {
items[0] = new SelectItem("", "---");
i++;
... |
f75b7754-7bd1-48d1-9219-98745f0bc22e | 0 | @Override
public void windowDeiconified(WindowEvent e) {
} |
4892d2c0-fa00-4dfe-b291-9673984a6ee0 | 0 | public void setPepMoaConsec(int pepMoaConsec) {
this.pepMoaConsec = pepMoaConsec;
} |
a6aa578f-8d33-4b43-8533-3d55d22c0ce4 | 0 | public double getTotal() {
return total;
} |
58322a11-3237-4d0e-b504-ea507718d40c | 4 | private DisplayState constructDisplayState() {
DisplayState.States s = imagePanel instanceof SingleImagePanel ?
DisplayState.States.SINGLE_IMAGE :
DisplayState.States.QUAD_IMAGE;
List<Command> filteredCommands = new ArrayList<Command>();
for(Command c : e... |
7a1cadc3-3892-4917-9795-3664ee0ed042 | 2 | public List<Item> getItems() {
final List<Item> items = new ArrayList<Item>();
for (Element element : elements)
if (element instanceof Item)
items.add((Item) element);
return items;
} |
21a95254-0827-4385-adbe-9d8acea0a167 | 1 | @SuppressWarnings("static-access")
public Dialog(boolean flag, String info) {
if (flag == true) {
this.showMessageDialog(null, "操作成功: 保存路径:" + info, "操作信息", JOptionPane.PLAIN_MESSAGE);
} else {
this.showMessageDialog(null, "操作失败:导入的表错误,请重新检查。", "操作信息", JOptionPane.ERROR_MESSAGE);
}
this.setVisible(true);... |
e49ce6cb-ac51-4fe8-8838-1240df359912 | 9 | @Override
public BufferedImage renderFile(String fileName, InputStream input) throws IOException {
ByteCountingDataInputStream in = new ByteCountingDataInputStream(input);
PriorityQueue<Integer> chunkIndexes = new PriorityQueue<>(
new Comparator<Integer>() {
@Override
... |
63e73df5-32da-4d13-9314-5eb319a98dfa | 1 | public boolean isEmpty() // Check if queue is Empty.
{
if(peek() == null) //if head is null the list isEmpty
return true;
else
return false;
} |
3b21fef1-1379-4e5e-a5d4-0ff487e919bd | 1 | public ArrayList<String> moviesToList(){
ArrayList<String> temp = new ArrayList<>();
for (Movie movie : movies) {
temp.add(movie.getName());
}
return temp;
} |
096d5f0f-22bf-4036-ac24-df2587198909 | 8 | public boolean equal(CDCRelation c){
return (r[0][0]==c.r[0][0] && r[0][1]==c.r[0][1] && r[0][2]==c.r[0][2]
&& r[1][0]==c.r[1][0] && r[1][1]==c.r[1][1] && r[1][2]==c.r[1][2]
&& r[2][0]==c.r[2][0] && r[2][1]==c.r[2][1] && r[2][2]==c.r[2][2]);
} |
7502d0e4-ac4e-444f-9e85-d775f45b06ea | 6 | public ArrayList<Item> getItemList() {
if (scanner.findInLine(firstLine) != null) {
scanner.nextLine();
}
list = new ArrayList<Item>();
while (scanner.hasNextLine()) {
String[] line = scanner.nextLine().split("; ");
if (line.length == 6) {
String type = line[0];
String title = line[1];
... |
3ae771e8-8edc-41a9-bde6-bbfc9ea76978 | 2 | public void storeMessage(final RenderMessage message) {
//Render and disappear it
new Thread() {
public void run() {
MESSAGE = message;
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.print... |
7e3294f0-21b2-48fb-b9dd-c14994ae3ffe | 8 | public void putAll( Map<? extends Integer, ? extends Short> map ) {
Iterator<? extends Entry<? extends Integer,? extends Short>> it =
map.entrySet().iterator();
for ( int i = map.size(); i-- > 0; ) {
Entry<? extends Integer,? extends Short> e = it.next();
this.put( e.... |
0d09eb0b-c4a8-4221-9f9c-94b192334d60 | 8 | private static String printClusterStats(Clusterer clusterer, String fileName)
throws Exception {
StringBuffer text = new StringBuffer();
int i = 0;
int cnum;
double loglk = 0.0;
int cc = clusterer.numberOfClusters();
double[] instanceStats = new double[cc];
int unclusteredInstances = 0;
if (fileName... |
2fa831cf-e67d-40e3-afa9-6be5b4921e09 | 6 | public double getLocalSignedDistance(Vector3d position, Matrix3d rotation,
Vector3d point) {
Vector3d localPoint = getLocalPoint(position, rotation, point);
// Calling methods should catch this since it means that a potentially
// intersecting point is not intersecting after all.
if ((localPoint.x > signedD... |
05f5867e-5157-4b39-8b76-6ea551e87774 | 4 | public String getTimerFile() {
boolean test = false;
if (test || m_test) {
System.out.println("FileManager :: getTimerFile() BEGIN");
}
if (test || m_test) {
System.out.println("FileManager :: getTimerFile() END");
}
return TIMER_FILE;
} |
061f1a91-4bf4-49a4-837e-8a6d324cfbea | 7 | public static boolean computeCell(boolean[][] world, int col, int row) {
boolean liveCell = getCell(world, col, row);
int neighbours = countNeighbours(world, col, row);
boolean nextCell = false;
if (neighbours < 2) nextCell = false;
if (liveCell && (neighbours == 2 || neighbours == 3)) nextCell = tru... |
bcc8c971-d3c3-4390-b567-9a19b1583ee8 | 1 | private void fireClientDisconnectEvent(DisconnectOnServerEvent evt) {
try {
ISocketServerConnection ssc = evt.getClientConnection();
logger.debug(getName() + " disconnect client: " + ssc.getRemoteAddress() +
" <idconnection=" + ssc.getIdConnection() +
", count=" + remoteServ... |
82cdd6d5-9055-49eb-b054-6d902691646d | 8 | final Interface18_Impl3 method3861(int i, byte i_88_, int i_89_,
Class68 class68, Class304 class304) {
try {
if (i_88_ != -84)
method3842(false);
anInt9882++;
if (aBoolean9926 || (Class192.method1436(i_88_ + 15, i_89_)
&& Class192.method1436(65, i)))
return new Class14_Sub1(this, cla... |
1852bde9-5a82-4058-9a51-932ed693d847 | 4 | private synchronized void removeBlockRequest(Message.PieceMessage message) {
if (this.requests == null) {
return;
}
for (Message.RequestMessage request : this.requests) {
if (request.getPiece() == message.getPiece() &&
request.getOffset() == message.getOffset()) {
this.requests.remove(request);
... |
bdc0d345-1bd9-4b11-adce-b2a0e2875224 | 5 | private int getNeedCallsForNextDepth(int[][][] newBoards) {
int r = 0;
for (int[][] board : newBoards) {
if (board == null) {
continue;
}
for (int[] row : board) {
for (int val : row) {
if (val == 0) {
... |
4753532d-9769-49e6-ad75-b6ceb2c41e94 | 1 | private Transition mergeOutgoingTransitions(Transition t1, Transition t2) throws NoSuchTransitionException, Exception {
for(String c:t2.getInput()) {
addLabelToOutgoingTransition(t1, c);
}
return t1;
} |
4ccece0d-9c4e-4602-92a9-6d3506a52fcb | 0 | protected PasswordDialog(Frame owner, String loginName) {
super(owner);
this.setModalityType(ModalityType.DOCUMENT_MODAL);
this.setTitle("");
GridBagLayout layout = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
this.setLayout(layout);
c.gridwidth = GridBagConstraints.REMAINDER;
... |
a7040c8a-cd8c-4645-8690-29aae241f860 | 2 | public String getMidTime24(){
int hourI = this.getHour24();
this.midTime24 = (new Integer(hourI)).toString();
int minI = this.getMinute();
if(minI<10){
this.midTime24 += ".0" + minI;
}
else{
this.midTime24 += "." + minI;
}
int secI ... |
48d00136-ebdc-4ab3-a735-a8cbae02f5f9 | 8 | protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
String funcion = request.getParameter("funcion");
... |
acaa0b50-9ec0-4345-9cef-69f03836741e | 8 | private JButton createContinueGameButton()
{
JButton continueGameButton = new JButton(Messages.getString("Driver.loadGame")); //$NON-NLS-1$
continueGameButton.setToolTipText(Messages.getString("Driver.loadASavedGame")); //$NON-NLS-1$
try
{
continueGameButton.setIcon(GuiUtility.createImageIcon(30, 30, "/save... |
130def65-407b-45ce-afd2-99c1e0ffc24e | 2 | private void push(JSONObject jo) throws JSONException {
if (this.top >= maxdepth) {
throw new JSONException("Nesting too deep.");
}
this.stack[this.top] = jo;
this.mode = jo == null ? 'a' : 'k';
this.top += 1;
} |
30485cdb-6d29-42cf-b9be-194f1700f404 | 6 | private void getConstants()
{
HashMap<String,String> l_data = this.ctrl_configuration.getConfigurationData();
if (l_data == null)
return;
if(l_data.containsKey("filetransfertport"))
this.ctrl_fileTransfertPort = Integer.parseInt( l_data.get("filetransfertport"));
if(l_data.containsKey("netdetect... |
54bb963d-2fd4-4ce8-9a57-03f4f90a2037 | 9 | public static void findAndAddClassesInPackageByFile(String packageName,
String packagePath, final boolean recursive, Set<Class<?>> classes) {
// 获取此包的目录 建立一个File
File dir = new File(packagePath);
// 如果不存在或者 也不是目录就直接返回
if (!dir.exists() || !dir.isDirectory()) {
// log.warn("用户定义包名 " + packageName + " 下没有任何... |
487135ed-7812-474e-bcd6-c5077585ecdf | 1 | public void clearNodeScope(Node n) {
while (sp > mk) {
popNode();
}
mk = marks.remove(marks.size()-1);
} |
32bda5a9-254d-4712-b6ff-3a576de78c56 | 4 | @Override
public boolean createTraining(Training training) {
Connection connection = new DbConnection().getConnection();
PreparedStatement preparedStatement = null;
boolean flag = false;
try {
preparedStatement = connection.prepareStatement(INSERT_TRAINING);
preparedStatement.setString(1, training.getTr... |
6f71e60a-d626-4eac-87ac-9b611e966fe3 | 7 | public static void bottomDiamond() {
final int SIZE = 3;
int cnt = 0;
for (int j = SIZE; j > 0; j--) {
System.out.print("|");
for (int i = 0; i < cnt; i++) {
System.out.print(".");
}
for (int i = 1; i <=j; i++) {
System.out.print("\\/");
}
fo... |
02eb8073-70ba-46f7-9a68-584721d0c44f | 1 | public float getZAxisDeadZone() {
if (zaxis == -1) {
return 0;
}
return getDeadZone(zaxis);
} |
d1083bde-06f0-405d-8144-0b6491ac3c1f | 4 | protected int parseToken(boolean eof_ok) throws FormatterError {
int status;
int rc;
try {
status = st.nextToken();
} catch (Exception e) {
throw new FormatterError("parseToken: st.nextToken failed");
}
s = "";
if (status == StreamTokeni... |
65ec356e-c260-49f7-9e8e-3d64f9b711ee | 1 | public synchronized void adicionar()
{
try
{
new FonteFinanciamentoView(this);
}
catch (Exception e)
{
}
} |
c730ee92-3649-4a85-b173-fd9474406b65 | 8 | public double interpolate(double xIter) {
int np = this.xArray.length; // number of points double d[] = new double[np]; // Newton form coefficients
double x[] = xArray;//new double[np]; // x-coordinates of nodes
double d[] = yArray;
double y;
double t;
... |
6a4ebd77-6b31-48b5-9763-fa8db82b2879 | 0 | public void close() {
buffer.disableRenderer(IRenderer.RENDERER_OPENGL);
buffer.dispose();
} |
8de9005c-0d8d-446a-bb1c-e89d22d129e4 | 6 | public String getToolTipText(MouseEvent event){
//block the appearence of the ToolTip when the simulation is runing. This prevents the
//simulation from getting inconsistencies from multiple threads drawing into the same
//buffer
if(Global.isRunning){
return null;
}
Edge edgeUnderPos = null;
E... |
0a8751cd-84bf-475f-bc67-132e79d08204 | 8 | final void method965(int i, int i_74_, int i_75_, int i_76_, int i_77_,
int i_78_, int i_79_) {
anInt8442++;
int i_80_ = i_75_ + i;
int i_81_ = i_76_ + i_74_;
aClass258_Sub3_Sub1_8434.method1957(9728, false);
aHa_Sub2_8430.method3792(54);
aHa_Sub2_8430.method3771((byte) -88, aClass258_Sub3_Sub1_8434);
aHa_Su... |
57a41120-9e92-4498-a64b-23c570817393 | 9 | public static List findMatchableGoals(Proposition forallprop, Keyword headortail) {
{ int index = ((headortail == Logic.KWD_HEAD) ? 1 : 0);
Proposition proposition = ((Proposition)((forallprop.arguments.theArray)[index]));
Cons variables = Stella.NIL;
List resultlist = List.newList();
{ Pat... |
ba3ef4f2-a744-4da4-9a2b-b49da6a2afcd | 1 | @Override
public void onError(Throwable ex) {
if (WebSocket.DEBUG)
ex.printStackTrace();
} |
ee6d459a-c32d-44a8-a1bd-bc289abebc7d | 9 | static void writeActuals(List<TableEntity> tables, Workbook wb) {
int sheets = wb.getNumberOfSheets();
for (int i = 0; i < sheets; i++) {
if (wb.getSheetAt(i).getSheetName().contains("check")) {
Sheet sheet = wb.getSheetAt(i);
int first = sheet.getFirstRowNum(... |
307b89c0-4d6c-43ad-8887-e0acaef95641 | 2 | @Override
public void saveGame(int id, String name) throws IOException{
XStream xstream = new XStream();
ServerModel game = gameModelsList.get(id);
String xml = xstream.toXML(game);
File file = new File("saves/");
if (!file.exists()) {
if (file.mkdir()) {
System.out.println("Directory is created!");
... |
6997ff27-4b00-468f-baf4-1b88657a4f77 | 1 | public void start() {
Thread t = threadVar.get();
if (t != null) {
t.start();
}
} |
83800920-fd7f-4ec9-be10-bff21cf6654c | 0 | public void addDocumentListener(DocumentListener l) {
documentListeners.add(l);
} |
8bbc2809-9813-4f94-8945-194c536cea14 | 3 | @Override
public boolean equals(Object o) {
Transition tmpT = (Transition) o;
return tmpT.node.equals(node) && tmpT.character.equals(character) && tmpT.leftChildren.equals(leftChildren) && tmpT.rightChildren.equals(rightChildren);
} |
1b67c9f1-0e0f-434f-9fd2-34a2ee4c4b7e | 6 | @Override
public void insertUpdate(DocumentEvent event) {
if(event.getDocument() == nameTb.getDocument() || event.getDocument() == messageTbLeft.getDocument()){
previewLeft.update(messageTbLeft.getText(), "%JOINEDPLAYER%", nameTb.getText());
if(nameTb.getText().equalsIgnoreCase("join-format-string"))
b... |
ca27ccf9-fac4-4576-a0b4-6771ea4a035a | 5 | @Test //별로 필요없음.
public void testDomReader(){
String uri="/Users/kimgyupyo/study/project/workspace/ResourceManager/src/test/java/file.xml";
try {
File file = new File(uri);
DocumentBuilderFactory docBuildFact = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuild = docBuildFact.newDocumentBu... |
3eefd760-b978-49c8-8e17-4d73d334b980 | 0 | public static List<Secteur> selectAll(EntityManager em) throws PersistenceException {
List<Secteur> lesSecteurs = null;
Query query= em.createQuery("select s from Secteur s");
lesSecteurs = query.getResultList();
return lesSecteurs;
} |
12e69f84-7dd4-418e-8908-9964d7679feb | 5 | private void getFileData()
{
ArrayList<String> fileList = null;
fileList = file.getLines();
Pattern basicPattern = Pattern.compile("<(\\w+)><(\\d+)>");
for (String line: fileList)
{
Matcher matcher = basicPattern.matcher(line);
if (matcher.find())
{
if (matcher.group(1).equals("sensitivity"))
... |
a4f689a2-a417-42cc-acc9-c7753485183c | 3 | private int[] calculateExpectedAndStandardDev(int[] platter) {
int[] bowl;
int total_score = 0;
int max_score = -1;
int[] samples = new int[SAMPLE_NUM];
for (int i=0; i < SAMPLE_NUM; i++) {
bowl = createBowl(platter);
int bowl_score = scoreBowl(bowl);
... |
47307df4-76b9-4a62-88b1-6156a9226a7e | 2 | protected void ensureSpaceFor(int entries) {
if(entries < buf.length)
return;
int newCap = entries;
if(initialCapacity > (newCap/2)) {
newCap += initialCapacity;
} else {
newCap += (newCap/2);
}
_reallocate(newCap);
} |
ecea5661-e208-4f36-8578-d0888963299f | 7 | public TreeAppearanceController(final TreeViewer treeViewer) {
this.treeViewer = treeViewer;
final AttributableDecorator branchDecorator = new AttributableDecorator();
branchDecorator.setPaintAttributeName("!color");
branchDecorator.setStrokeAttributeName("!stroke");
treeViewer.... |
9b28b29e-906c-484e-9685-94ad711e7592 | 1 | public void OptionsMain() {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
@SuppressWarnings("unused")
OptionsMenu frame2 = new OptionsMenu();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
} |
ede709ed-0a0f-4500-99a6-6e145903d911 | 9 | private List<List<Double>> getPairedCutPoints(List<Double> otherPoints, double digestionRate) {
List<Double> thisPairedCutPoints = new ArrayList<Double>();
List<Double> otherPairedCutPoints = new ArrayList<Double>();
List<Double> thisCuts = (flipped ? cutsFlipped : cuts);
// Calculate all of the pairwise dis... |
7974ceab-0795-4d76-989f-884d433b6899 | 8 | public static void main(String[] args) {
// TODO Auto-generated method stub
TC.lectureDansFichier("doodle.txt");
TC.ecritureDansNouveauFichier("out.txt");
String s = TC.lireLigne();
r = Integer.parseInt(TC.motsDeChaine(s)[0]);
c = Integer.parseInt(TC.motsDeChaine(s)[1]);
img = new boolean[r][c];
colored... |
b7469da3-fa8a-40c9-b2b4-9730c6dbd0aa | 8 | public JSONObject getNotificationsTag(int USER_ID)
{
ResultSet rstemp = null;
ResultSet rstemp1=null;
Statement stmt1=null;
try {
Class.forName(JDBC_DRIVER);
conn=DriverManager.getConnection(DB_URL,USER,PASS);
stmt=conn.createStatement();
stmt1=conn.createStatement();
json=new JSO... |
f63a7b71-8de6-49eb-b30a-fc3404f22990 | 1 | public void run()
{
while (reader.readPacket() == null)
;
} |
11d924dc-86b8-4ec5-bb0d-2db55ed24b07 | 7 | public int divide(int[] tmpArray){
int center = tmpArray[tmpArray.length-1];
int j;
int i = 0;
if(tmpArray.length <= 2){
if(tmpArray[0] < tmpArray[1]){
j = -1;
}else{
j = -2;
}
}else{
while((i < tmpArray.length-2)&&(tmpArray[i] <= center)){
i++;
}
j = i;
if(i < tmpArray.le... |
62fad429-3bfd-4db6-b9b7-e607799811d9 | 4 | @Override
public String getLocation()
{
String ret = super.getLocation();
if( ret.indexOf( "!" ) == -1 )
{ // doesn't have a sheet ref
// NOTE: Our tests error when PtgRefs have fully qualified range syntax
if( sheetname == null )
{
sheetname = getSheetName();
}
if( sheetname != null )
{
... |
4d274f55-0295-4628-8afd-bf27033b28cf | 3 | public void actionPerformed(ActionEvent ev)
{
try
{
Local objt = classeView();
if (obj == null)
{
long x = new LocalDAO().inserir(objt);
objt.setId(x);
JOptionPane.showMessageDialog(null,
"Os dados foram inseridos com sucesso", "Sucesso", JOptionPane.INFORMATION_MESSAGE);
if (tabela ... |
e9ef2568-d649-4288-8344-e568d0dca82f | 0 | public NetStatPackage receiveStatusPackage() {
statusAvailable.acquireUninterruptibly();
return netStatBuffer.pop();
} |
f1f93119-444d-4f51-9c1f-f258a5b552c3 | 0 | public String getUsername() {
return this.username;
} |
ea46d346-354f-48cf-b5c3-28a1d045c21b | 1 | public VariableStack mapStackToLocal(VariableStack stack) {
if (!stack.isEmpty())
throw new IllegalArgumentException("stack is not empty at RET");
return null;
} |
85af18e8-2cdb-47b0-9d29-8fc648486ec4 | 8 | public void onHit(Physicsable source) {
if(hitBy.contains(source)) return;
hitBy.add(source);
health -= source.damage;
if(source instanceof Meteor) health -= source.damage * 3;
if(health >= 1) return;
FMath.playSound("Meteor_Destroy0");
remove();
if(size < 18) return;
ArrayList<Meteor> mete... |
cf7af06b-2fe4-4859-acc0-ddb055adb64f | 6 | private static void shortPrintStackTrace2(final Throwable throwable, final StackTraceElement[] causedTrace, final Object cause)
{
final StackTraceElement[] trace = throwable.getStackTrace();
int m = trace.length - 1, n = causedTrace.length - 1;
while (m >= 0 && n >= 0 && trace[m].equals(causedTrace[n]))
{
m... |
add80ba6-1e88-4fb5-aba8-26fdaf5d29a2 | 0 | public void setBookings(Collection<BookingEntity> bookings) {
this.bookings = bookings;
} |
0061b90f-3179-464f-967b-e2ed4ca4a203 | 7 | private static int writeLines(String fname, BufferedReader in) {
try {
byte[] buf = new byte[blockSize];
int i = 0;
for (;;) {
String line = in.readLine();
if (line == null || line.equals(".")) {
break;
}
... |
de3b4c27-f2c4-4784-b5ca-335b2c580ce3 | 3 | @Override
public void mouseMoved(MouseEvent mouse) {
Tool tool = controls.getTool();
//spravy
if (tool.compatible(ToolTarget.message)) {
if (selectedMessage != null) {
selectedMessage.selected = 0;
}
selectedMessage = graph.getMessage(mouse... |
8c3f55ce-fc74-4b31-8949-0c1d059d4618 | 7 | protected void addMissing(Instances data, int level,
boolean predictorMissing, boolean classMissing) {
int classIndex = data.classIndex();
Random random = new Random(1);
for (int i = 0; i < data.numInstances(); i++) {
Instance current = data.instance(i);
for (int j = 0; j < data.numAt... |
a53d7c02-6910-4d35-afeb-70bb44aa02e8 | 3 | @Override
public void onEnable() {
PluginDescriptionFile pdfFile = this.getDescription();
getConfig().options().copyDefaults(true);
saveConfig();
if (!setupPermissions()) {
this.log.warning(prefix + ChatColor.RED + "Permission Failure! - Make sure that you have... |
f3091eb3-24f0-43e7-8ec7-b3111c63ccc2 | 0 | public int getCap()
{
return MAXSIZE;
} |
eef82272-a09f-44f6-8de6-fae886e189d7 | 6 | @Override
public void run() {
long lastLoopTime = System.nanoTime();
final long OPTIMAL_TIME = 1000000000 / TARGET_FPS;
long lastFpsTime = 0;
fps = 0;
counter = 0;
while (true) {
try {
//<editor-fold defaultstate="collapsed" desc="all updat... |
14ff031a-3adb-4387-9ebd-ef8a6a734dbe | 8 | protected Attr[] sortAttributes(NamedNodeMap attrs) {
int len = (attrs != null) ? attrs.getLength() : 0;
Attr array[] = new Attr[len];
for ( int i = 0; i < len; i++ ) {
array[i] = (Attr)attrs.item(i);
}
for ( int i = 0; i < len - 1; i++ ) {
String name = null;
i... |
1505dfd5-0ae1-47bb-9458-b783168711bb | 0 | @RequestMapping(value = "/lat/index", method = RequestMethod.GET)
public String index(Model model) {
List<Lat> lats = latDao.findAll();
model.addAttribute("lats", lats);
return "lat/index";
} |
4597514e-ef7d-42ce-8881-0bc3529bf7d5 | 9 | private void verticalAlignment(Digraph<BrandesKoepfNode,Boolean> graph, List<List<BrandesKoepfNode>> layers, int mode) {
for (BrandesKoepfNode v : graph.vertices()) {
v.root = v;
v.align = v;
}
switch (mode) {
case LEFTMOST_UPPER:
for (int i = 1; i < layers.size(); i++) {
verticalAlignmentLeft(grap... |
0c3fe96c-ef4b-4c32-bd8f-af2041b2071a | 6 | private boolean conditionC0(String value, int index) {
if (contains(value, index, 4, "CHIA")) {
return true;
} else if (index <= 1) {
return false;
} else if (isVowel(charAt(value, index - 2))) {
return false;
} else if (!contains(value, index - 1, 3, "ACH")) {
return false;
} else {
char c = c... |
c51f787d-dbe2-4b20-a456-b9ffc18b873b | 4 | private boolean isValidWallCoverage(Grid grid) {
int wallCount = 0;
for (Element e : grid.getElementsOnGrid())
if (e instanceof Wall)
wallCount++;
if (wallCount > 1 && (wallCount * 100 / grid.gridSize() <= 20))
return true;
return false;
} |
3023440a-d495-41f2-b08a-84303b2f47cf | 8 | @Override
public void keyPressed(int keyCode, char keyName) {
if(keyCode == 200) {
if(!player.isMoving) {
player.isMoving = true;
player.movePlayer(Direction.UP);
}
}
if(keyCode == 203) {
if(!player.isMoving) {
player.isMoving = true;
player.movePlayer(Direction.LEFT);
}
}
if(ke... |
7e90a9db-bcf5-44ee-9ba5-3aa0ee04e556 | 0 | public String toString() {
return name;
} |
99e40f0f-d711-4b7d-99bd-10f7fa334374 | 6 | public void init(int i, int j, VilainType v) {
if(!(i>=0 && j>=0))
throw new PreConditionError("i>= && j>=0");
super.init(i, j, v);
if(!(super.getType()==v))
throw new PostConditionError("getType(init(i,j,v)) == v");
if(!(super.getX() == i))
throw new PostConditionError("getX(init(i,j,v)) == i");
if(... |
c86e0ca6-e3a0-4d75-901e-cc9ffeea711d | 2 | public void overrideLR(int f) {
// for keyboard input
Doodle doodle2 = (Doodle) myGuys.get(0);
doodle2.setHFacing(f);
// set image L and R
if (f == -1) {
myImages.set(0, doodleLImg);
doodle2.setX(doodle2.getX());
} else if (f == 1) {
myImages.set(0, doodleRImg);
doodle2.setX(doodle2.getX());
... |
bfbfdcd0-2f41-490b-99bd-d506403c5e7b | 7 | @Override
public int hashCode() {
int hash = 7;
hash = 67 * hash + this.id;
hash = 67 * hash + (this.login != null ? this.login.hashCode() : 0);
hash = 67 * hash + (this.password != null ? this.password.hashCode() : 0);
hash = 67 * hash + (this.nome != null ? this.nome.hashCo... |
8045c923-20ab-49e9-b6ce-92a2bec32e33 | 6 | public void login() {
try {
// Process Login
loginResult = null;
ProcessLogin processLogin = new ProcessLogin() {
public void onComplete() {
if(getErrorCode() != null) {
if(processInit != null) {
processInit.setErrorCode(getErrorCode());
}
} else {
TravelSDK.INSTANCE.lo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.