method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
b0149d2a-9b06-4a15-89d1-ffa3a7132ecc | 5 | protected static double[][] getArray( Ptg operand ) throws Exception
{
int nrows;
int ncols;
double[][] arr = null;
if( operand instanceof PtgRef )
{
int[] rc = ((PtgRef) operand).getIntLocation();
String sheet = ((PtgRef) operand).getSheetName();
WorkBook bk = operand.getParentRec().getWorkBook();... |
045e6f79-f080-4fd2-b49c-a54915b12b83 | 8 | public void loadDataS3M(RandomAccessFile fp, int ffi) throws IOException
{
byte[] b = new byte[28];
int instype = fp.read();
// don't load adlib instruments!
if(instype != 1)
return;
this.fname = Util.readStringNoNul(fp, b, 12);
int samplepointer = 0;
samplepointer += fp.read()<<16;
samp... |
6d50d7c1-9907-4005-b0ac-495a4d52cd94 | 5 | private void showPages () {
if (numPages == 2) {
try {
leftPageF.setIcon(new ImageIcon((Image) eMediumViewer.getPage(pageNum,
screenSize.width / numPages, screenSize.height)));
} catch (NoSuchPageException e) {
// Ignore error in full screen mode
pageNum -= 2;
}
try {
right... |
75c41eb0-7389-4941-bda3-068df08a5ca1 | 1 | public Statistik neueStatistikErstellen(int idOrgaEinheit,
int kalenderWoche, int jahr, int idStrichart, int strichanzahl) {
Statistik rueckgabe = null;
try {
rueckgabe = new Statistik(idOrgaEinheit, kalenderWoche, jahr,
idStrichart, strichanzahl, db);
} catch (SQLException e) {
System.out.println(e... |
10de2d76-8638-4b70-871b-70f76109d024 | 4 | public void actionPerformed( ActionEvent e ) {
if( e.getSource() == this.buttonStartServer ) {
this.newServerDialog.setVisible( true );
} else if( e.getSource() == buttonStopServer ) {
int row = this.serverSocketTable.getSelectedRow();
if( row == -1 ) {
setStatus( "No row is selected." );
... |
b0d143cf-2e7a-46da-bbee-432c11cd4e41 | 1 | private Image createImage(String path, String description) {
URL imageURL = Main.class.getResource(path);
if (imageURL == null) {
System.err.println("Resource not found: " + imageURL);
return null;
} else {
return (new ImageIcon(imageURL, description)).getIma... |
2911d8ad-8f0f-4c08-9fc1-18c67cc9b944 | 6 | private void drawEntry(Entry<DynamicCell, Computation> entry, Graphics2D g2d) {
if(showHideCellTowerAndEdges) {
drawCell(entry.getKey(), 6, g2d, Color.black);
}
if(showhideMeasurements) {
for(Measurement m : entry.getKey().getMeasurements()) {
int mX = doubleToInt(X_AXIS_FIRST_X_COORD+m.getCoordi... |
003abbb0-8468-4c6c-8a88-3ec6a8f49f97 | 0 | protected void onRemoveTopicProtection(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} |
0679fff5-3b8e-4579-8781-433c155f25ec | 2 | public static boolean valida_mail(String email) {
String mail_pat = "^[A-Za-z0-9_](\\.?[\\w-]+)*@[a-zA-Z]+(\\.[a-zA-z]+){1,2}$";
if (email == null) {
return false;
}
return email.matches(mail_pat) && email.length() <= 70;
} |
6fd25a9f-9316-4eff-afdd-bcd80ffb5d84 | 8 | public void bloqueoOAmenazo(Movimiento movimiento) {
// voy de < a > esfuerzo
// si es el mismo omito
if (movimiento.getTrebejo().equals(this)) {
return;
}
// si es hay uno del mismo bando ocupando el lugar
if (movimiento.getTrebejo().getBlanca().equals(blanca)
&& movimiento.getDestino().equals(th... |
14858aab-abd8-4b38-b8d8-3a636bca156e | 7 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
LangProjectKey other = (LangProjectKey) obj;
if (language == null) {
if (other.language != null)
return false;
} else if (!language.equa... |
cb2b601e-ded6-43ed-8dba-4b652df08084 | 5 | public int[] getBorderSizes()
{
int[] sizes = new int[5];
if( borderElements.get( "top" ) != null )
{
sizes[0] = borderElements.get( "top" ).getBorderSize();
}
if( borderElements.get( "left" ) != null )
{
sizes[1] = borderElements.get( "left" ).getBorderSize();
}
if( borderElements.get( "bottom" ... |
67f2c358-ada2-4f4a-8dc5-907601966894 | 4 | @Override
public Vector<Card> makeMove(Vector<Card> opponentMove) {
Vector<Card> move = new Vector<Card>();
Vector<Card> take = new Vector<Card>();
if (opponentMove == null) {
move.add(findTheMostUselessCard());
} else {
for (int i = 0; i < opponentMove.size... |
089f42f1-93cd-477e-b87f-9c4486022c12 | 4 | @Override
public void undo() {
if (prevSpeed == CeilingFan.HIGH) {
ceilingFan.high();
}
if (prevSpeed == CeilingFan.MEDIUM) {
ceilingFan.medium();
}
if (prevSpeed == CeilingFan.LOW) {
ceilingFan.low();
}
if (prevSpeed == Cei... |
f4d5d558-fd62-4fa1-b2c7-a02f37cd2b34 | 1 | public void inventory() {
itemsInventory.add("Matches");
itemsInventory.add("Torch");
itemsInventory.add("Iron Dagger");
for(int i = 0; i<itemsInventory.size(); i++) {
System.out.printf(" \n");
System.out.printf(" X-------------------------------... |
d0ac294c-0b5e-42e7-a857-a369cd3379ad | 7 | public List searchMatching(Connection conn, MapAccountCustomer valueObject) throws SQLException {
List searchResults;
boolean first = true;
StringBuffer sql = new StringBuffer("SELECT * FROM map_account_customer WHERE 1=1 ");
if (valueObject.getMap_id() != 0) {
i... |
361d4d62-f0a6-4013-9171-14aa20b8a7d8 | 8 | public void init() {
if (inited) {
return;
}
Log.info("Initialising sounds..");
inited = true;
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
try {
AL.create();
soundWor... |
6b64fead-0e91-4440-b0ee-2a2293974d20 | 6 | public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... |
5d37d0b7-5116-45be-a3bb-2dfeae9ffce6 | 2 | private List<? extends TypeMirror> getTypeMirrors(
List<AnnotationValue> annotationValues) {
List<TypeMirror> list = new ArrayList<TypeMirror>();
for (AnnotationValue o : annotationValues) {
list.add((DeclaredType) o.getValue());
}
return list;
} |
b3193bbd-21fa-443e-ab3d-8eee92979370 | 3 | private void writeFields(final DataOutputStream out, final Set onlyFields)
throws IOException {
out.writeShort(fields.length);
for (int i = 0; i < fields.length; i++) {
if ((onlyFields != null) && onlyFields.contains(fields[i])) {
continue;
}
fields[i].write(out);
}
} |
3470303c-71c7-4238-930c-f0c17e119ca1 | 3 | public JSONObject putOnce(String key, Object value) throws JSONException {
if (key != null && value != null) {
if (this.opt(key) != null) {
throw new JSONException("Duplicate key \"" + key + "\"");
}
this.put(key, value);
}
return this;
} |
a48f791f-6c96-4db9-b6fc-f9bc827932c1 | 2 | public static Fournisseur SelectFournisseurById(int id) throws SQLException {
String query = null;
Fournisseur fournisseur = new Fournisseur();
ResultSet resultat;
try {
query = "SELECT * from FOURNISSEUR where ID_FOURNISSEUR=? ";
PreparedStatement pStatement = ... |
635341a4-faa7-4912-a1a0-62e205b937b7 | 8 | public ListNode mergeKLists(ArrayList<ListNode> lists) {
ListNode rst = null;
if (lists.size() == 0)
return null;
else if (lists.size() == 1)
return lists.get(0);
PriorityQueue<ListNode> queue = new PriorityQueue<ListNode>(
lists.size(), new ListNodeComparer());
for (ListNode node : lists)
{
if... |
9d5d541a-afb1-4d50-8322-483fbc4ccfb2 | 6 | public String[] play(int start, int stop) {
if (start > 0 && start <= stop) {
int length = stop - start + 1;
String[] array = new String[length];
for (int i = 0; i < length; i++) {
if ((start + i) % 15 == 0) {
array[i]="Fizzbuzz";
} else
... |
2f4cd29a-420e-453c-8dcd-0529fdf6e4c9 | 0 | public void setStartDate(LocalDate value) {
this._startDate = value;
} |
e9bc101f-136e-46b3-8b61-a667db4c5df6 | 2 | @Override
public ParseResult<T, A> parse(LList<T> tokens) {
for(Parser<T,A> p: this.parsers) {
ParseResult<T,A> r = p.parse(tokens);
if(r.isSuccess()) {
return r;
}
}
return Fail.<T,A>of().parse(tokens);
} |
bbdfb6ab-4fab-4463-bda1-cfdcc0def166 | 0 | public CloseAction(Environment environment) {
super("Dismiss Tab", null);
this.environment = environment;
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,
MAIN_MENU_MASK));
environment.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
checkEnabled(... |
f6f5be8f-fc24-4723-94af-85aebea233b8 | 5 | public JSONObject increment(String key) throws JSONException {
Object value = this.opt(key);
if (value == null) {
this.put(key, 1);
} else if (value instanceof Integer) {
this.put(key, ((Integer) value).intValue() + 1);
} else if (value instanceof Long) {
... |
32aba5f8-eaee-43ed-81aa-6d98f43d14dc | 1 | @Test
public void springShouldInjectAllDependencies(){
StatisticService statisticService = new SpringDrivenStatisticService();
GameEventReceiver eventReceiver = statisticService.getEventReceiver();
GameStatisticProvider gameStatisticProvider = statisticService.getStatisticProvider();
List<GameEvent> eventHi... |
baaa491d-83c0-487a-9f28-74384ed7ae16 | 6 | private void internalReveal(int x, int y) {
//first check error conditions
if (!checkValidMove(x, y)) return;
Square square = board.getSquare(x, y);
//if square already clicked
if (square.isRevealed()) {
return;
}
//if square is flagged, do nothing
if (square.isFlagged()) {
return;
}
//che... |
d895da08-13b8-426e-a096-9a3248e2c620 | 7 | private ColorID defineColor(String color)
{
ColorID colorID = ColorID.WHITE;
if( color.equalsIgnoreCase("red")){
colorID = ColorID.RED;
}
else{
if( color.equalsIgnoreCase("orange")){
colorID = ColorID.ORANGE;
}
else{
... |
901a0913-75bb-4a86-8b3c-a855fcde69aa | 9 | @Override
public void run() {
while(true) {
try {
Object o = in.readObject();
if(o != null) {
// new client connected
// add to list with name and port
if(o instanceof JoinTransfer) {
JoinTransfer trans = (JoinTransfer) o;
LogicalClientsContainer.getInstance().add(new LogicalCli... |
7a1cd44e-f31b-469b-9ee5-40d38d3a0103 | 9 | public static void main(String[] args) throws DatabaseException, UnsupportedEncodingException {
// Open the environment, creating one if it does not exist
EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setTransactional(true);
envConfig.setAllowCreate(true);
Environment myDbEnvironment = new... |
5d54b4b8-c389-4554-8162-9523f9e650be | 2 | private void EscalaoTorneio_ComboBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_EscalaoTorneio_ComboBoxItemStateChanged
// TODO add your handling code here:
jList3.setModel(new DefaultListModel());
DefaultListModel model = (DefaultListModel) jList3.getModel();
for (... |
e7ee9624-2659-4a5b-9770-648009b9c267 | 5 | protected void handleControlPropertyChanged(final String PROPERTY) {
if ("UPDATE".equals(PROPERTY)) {
update();
} else if ("RESIZE".equals(PROPERTY)) {
resize();
update();
} else if ("PREF_SIZE".equals(PROPERTY)) {
aspectRatio = getSkinnable().getP... |
76d1f20f-294d-4eb7-94cd-a69f9eb9fa80 | 1 | @Test
public void createBillTest() {
Household hh = null;
try {
hh = familyService.findHousehold(0);
} catch (InstanceNotFoundException e) {
fail("Household not found");
}
billService.createBill(hh);
assertEquals(1, hh.getBills().size());
ArrayList<Bill> ar = new ArrayList<Bill>();
ar.addAll(hh.g... |
2ab4003e-7f11-48fd-80a3-1c561109c372 | 9 | @Override
public void update_orders(GeneralAIUnit unit, GeneralAI ai) {
// check if the spot we originally wanted to visit is no longer possible....
boolean removed = false;
if (farmers[FARMER_UP] == unit.stats.getID()) {
if (_farmers[FARMER_UP] == FARM_CLOSED) {
removed = true;
}
} else if (farmers[... |
68eedf85-11f9-4bbf-b729-0276eae3b894 | 4 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
String Sql = "Select * from administrateur where adresse_mail= ? and mot_de_passe = ? ";
String Sql1 = "Select * from clients where adresse_mail= ... |
d8ab73b2-1479-41f7-9a9f-899d4fa779a4 | 2 | public String getCode(){
String str = condition.getCode() +
this.printLineNumber(true) +
"if " + condition.place + " == false " +
"goto := " + String.valueOf(this.currentLineNumber + truePart.tLineCount() + 3) + "\n";
String trueCode = truePart.getCode();
str += (trueCode == "" ? "" : trueCo... |
a4b7ffae-444b-41b4-851e-0c1f0e53093c | 5 | public ArrayList<String> fullJustify(String[] words, int L) {
// Start typing your Java solution below
// DO NOT write main() function
int n = words.length;
ArrayList<String> res = new ArrayList<String>();
if (n == 0)
return res;
int i = 0, j = 0;
while (i < n) {
int cnt = 0;
for (j = i; j < n; j... |
68d646a0-b9ac-4290-9f70-960e4a15bfd2 | 2 | public void destroy (Account a)
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("destroy", true);
AccountHelper.write ($out, a);
$in = _invoke ($out);
return;
... |
e6144226-e696-47b5-83a0-5650457eb5a2 | 9 | @Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || this.getClass() != o.getClass()) {
return false;
}
@SuppressWarnings("unchecked")
BinaryTree<T> bt = (BinaryTree<T>) o;
if (data != null ? !d... |
1d3ff2e9-3601-4a1e-9385-d12283ccd515 | 8 | public static void saveWorld (World world, String filename) throws CriticalFailure
{
File file = new File(filename);
BufferedWriter writer = null;
try {
if (!file.exists())
{
file.createNewFile();
}
else
{
file.delete();
file.createNewFile();
}
writer = new BufferedWriter(new Fi... |
fe7ef5a4-d423-408b-8698-c53bd245d05f | 1 | public void jouer() throws Exception
{
while (true)
{
this.affichage.afficherPlateau(this.plateau);
this.affichage.afficherDemandeCoordonnees(joueurBlanc);
this.jouerUnCoup(this.joueurBlanc);
this.affichage.afficherPlateau(this.plateau);
this.affichage.afficherDemandeCoordonnees(joueurNoir);
... |
71bfb4f2-2202-432e-812d-df64cbdafa1f | 7 | public boolean isVisibleTo(Player player) {
Tile unitTile;
Settlement settlement;
return (player == getOwner()) ? true
: ((unitTile = getTile()) == null) ? false
: (!player.canSee(unitTile)) ? false
: ((settlement = getSettlement()) != null
&... |
70b9204c-b6ad-4ef9-917e-d79ce1fdc906 | 5 | public AnimMeteorite() {
anim_meteorite = new Animation();
SpriteSheet sp_fire = null;
try {
sp_fire = new SpriteSheet("resources/asteroid_bullet.png", 96, 80);
} catch (SlickException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
int frame_speed = 10;
f... |
48a2ff39-ffdb-407b-b309-2ff1d6527f4e | 7 | private boolean isMoveable(int x, int y) {
boolean cond;
int i, j;
for(i = 0; i < X; i++) {
for(j = 0; j < Y; j++) {
if(isVertical(y, j) &&
isHorizontal(x, y, i) &&
!isAlly(i, j) &&
!isBlank(i, j) ... |
ff865a12-4a18-47d3-864c-36ced5bd2731 | 1 | public void makeDeclaration(Set done) {
for (int i = 0; i < subExpressions.length; i++)
subExpressions[i].makeDeclaration(done);
} |
d0847e0a-703c-46f7-9f53-b1bd8d9deb59 | 8 | private DataBaseType getDBTypeFromShape(String classField){
DataBaseType type = null;
try {
if(classField.equals("Long") ||
classField.equals("Integer") ||
classField.equals("Double")){
//TODO Hacer la correspondencia entre tipos numericos
type = DataBaseType.decimal;
}else if(classField.equ... |
b1f5f4db-84d9-4fe3-a303-f1fd684b3ad0 | 5 | public void setPalette(boolean b) {
isPalette = b;
if (isPalette) {
closeButton.setIcon(paletteCloseIcon);
if (frame.isMaximizable()) {
remove(maxButton);
}
if (frame.isIconifiable()) {
remove(iconButton);
}
... |
b65e4a0d-5689-44b9-9a45-b07395dc5150 | 8 | public static LogicObject evaluatePredicateAndFirstArgument(Cons tree, Object [] MV_returnarray) {
{ Stella_Object predicate = tree.value;
Stella_Object firstargument = tree.rest.value;
if (Surrogate.subtypeOfP(Stella_Object.safePrimaryType(predicate), Logic.SGT_STELLA_GENERALIZED_SYMBOL)) {
{ ... |
ae3567bf-60dc-4ddb-8912-edd3d0dad82e | 7 | private void bounceOffObjects(SpaceObject uObj){
double disToMove;
double mass;
double mass2;
double massSum;
double massPercent;
double massPercent2;
double velSum;
//Obj:
double normX;
double normY;
double normLength;
double normUnitX;
double normUnitY;
double velX;
double velY;
double... |
8d529f3a-742f-43e2-b5a5-00f3105ab15a | 0 | public String getParkName(){
return parkName;
} |
e3cb7556-6f1a-4af9-8142-abfa75aaa6bc | 9 | protected AbstractTabWindow(boolean showContent, WindowItem windowItem) {
super(windowItem);
if (showContent) {
TabContentPanel contentPanel = new TabContentPanel() {
public Dimension getMinimumSize() {
if (getTabWindowProperties().getRespectChildWindowMinimumSize())
return s... |
45f152b5-1208-4423-8837-2e3675623bc2 | 4 | public static void searchOrExit() {
System.out.println("Would you like to search or Exit? (S/E)");
Scanner reader = new Scanner(System.in);
decision = reader.nextLine();
if (decision.equalsIgnoreCase("Exit") || decision.equalsIgnoreCase("E")) {
validMove = map.moveSouth();
validateMove();
System.ou... |
21ea8b44-9a70-454b-966d-78d08852bbf2 | 9 | private static SegmentConfig createSegment(TypeInfo info, Segment sa, Fields fields) {
updateTypeInfo(info, sa.type(), sa.collection());
if (info.propertyType == String.class) {
throw new IllegalArgumentException("type is undefined");
}
String target = toVal... |
a4e932fa-90ad-4ad2-bc46-090cc7746002 | 5 | private final void mutate()
{
if (Rand.percent() > Hub.simWindow.mutantOffspringSlider.getValue())
return;
seedEnergy += Rand.double_(-10, 10);
// mutate leaf colour
int[] leafColours = { leafColour.getRed(), leafColour.getGreen(), leafColour.getBlue() };
leafColours[Rand.int_(0, 2)] += Ra... |
df5b2e84-803d-4554-b621-adaeea08e07a | 0 | public void method_b(Myhandler myhandler){
myhandler.handler("超人");
} |
ee6740b8-4b92-4660-a7b9-322dcd0f13df | 4 | private CacheResult beforeDataAccess(Object[] args) throws CacheUnreachableException {
CacheResult cacheResult = new CacheResult(false);
CacheDefinition cacheDefinition = cacheDefinitionCollection.getCacheDefinition();
if (cacheDefinition == null) {
return cacheResult;
}
// 生成缓存对象的key
String key = cac... |
71eaa6a5-da76-429d-80e5-66a2816ed111 | 8 | @Override
public Model getRotatedModel() {
if (desc == null) {
return null;
}
Model model = method450();
if (model == null) {
return null;
}
super.height = model.height;
if (super.currentGraphic != -1 && super.anInt1521 != -1) {
... |
d3ae23ce-2502-4d3b-b452-3d0f96b8e643 | 4 | private void verificarNome(String nome, Integer tipo) throws Exception{
for(int i=0;i<nome.length();i++){
if(Character.isDigit(nome.charAt(i))){
if(tipo == 1){
throw new Exception("Contem numero no nome medico");
}else
... |
3aee6d6f-2a78-4d78-ac2a-3a9d537bb803 | 5 | public void run() {
DatagramPacket pack = new DatagramPacket(new byte[maxPacketSize], maxPacketSize);
while( true ) {
try {
pack.setLength(maxPacketSize);
sock.receive(pack);
} catch( IOException e ) {
throw new RuntimeException(e);
}
synchronized( packetListeners ) {
if( packetListe... |
d13e9ab9-36f6-4506-baf0-4cb69d408dc8 | 0 | public MicroScope() {
imageQueue = new Vector<File>();
DriverThread driver = new DriverThread(imageQueue);
System.out.println("Ready to start NIS program ...");
driver.start();
client = new FileServerClient("Micro-Response", "Micro-Request");
handler = new MicroRequestHan... |
ee89b144-3584-48e6-b83b-7bb5ade23729 | 4 | private void bubbleDown(int pos) {
int firstChildPos = 2*pos + 1;
int secondChildPos = 2*pos + 2;
int greaterChildPos = firstChildPos;
if(firstChildPos <= heapLen - 1) {
if(secondChildPos <= heapLen - 1) {
if(array[firstChildPos] < array[secondChildPos]) grea... |
7bf8e8d0-2e24-4728-83ee-8117225872a8 | 4 | public void remove(Ingredient n) {
if (bevat(n)) {
if (head.getNext() == null) {
head = null;
} else {
RNode finger = head;
RNode previous = null;
while (!(finger.getElement().equals(n))) {
previous = finger;
finger = finger.getNext();
}
if (finger != head) {
RNode k = fin... |
b8b58628-10c2-4ad2-bc74-3c48c498aa28 | 6 | private boolean ContainsSwearing(String message, List<Swear> swearList, Player[] onlinePlayers, Player sender) {
if(swearList.isEmpty())
return false;
for (Swear swear : swearList) {
if(message.matches(swear.getRegexSwear())){
//TODO: add console logging and Player notification
help.getLogger().info(s... |
620bf395-bd11-440b-936f-97b60e6a768d | 8 | public static Position voisin(Position origine,int orientation){
Position position = new Position() ;
switch(orientation){
case Orientation.NORD :
position.setRangee(origine.getRangee()-1) ;
position.setTravee(origine.getTravee()) ;
break ;
case Orientation.NORDEST :
position.setRangee(origine... |
0fb31039-55c9-48b1-b4f1-31fbab2ad604 | 2 | private int getSectionEndIndex(int start, char terminator) {
int i = start;
do {
i++;
if(i == arg.length()) {
// The string is never terminated
return -1;
}
} while(arg.charAt(i) != terminator);
return i;
} |
d77ccdda-997f-4b11-8bec-fb3b67e0cda5 | 4 | @Override
public void validarSemantica() {
Tipo cond=null;
try {
cond =condicion.validarSemantica();
} catch (Exception ex) {
Logger.getLogger(SentenciaWhile.class.getName()).log(Level.SEVERE, null, ex);
}
if(cond instanceof TipoBooleano){
S... |
9373a901-50ca-4399-982d-22fbecac7f3e | 5 | public MyUseAnalysis(UnitGraph graph)
{
if(Options.v().time())
Timers.v().liveTimer.start();
SimpleUsageAnalysis analysis = new SimpleUsageAnalysis(graph);
if(Options.v().time())
Timers.v().livePostTimer.start();
// Build unitToLocals map
... |
8e14c604-df36-4621-a166-2465729fdbe9 | 8 | private static void typeFlow(OptFunctionNode fn, Node[] statementNodes, Block theBlocks[], int[] varTypes)
{
boolean visit[] = new boolean[theBlocks.length];
boolean doneOnce[] = new boolean[theBlocks.length];
int vIndex = 0;
boolean needRescan = false;
visit[vIndex] = true;
... |
6ef82b0a-de5f-4994-9044-2ec34506768d | 4 | public void setCustomList(String field, List<?> x)
{
if (x == null)
{
set(field, null);
return;
}
if (x.get(0) == null)
{
set(field, "");
return;
}
String a = String.valueOf(x.get(0));
for (int i = 1; i < x.size(); i++)
a += "," + String.valueOf(x.get(i));
set(field, a);
} |
b5d93d9b-98d6-4963-a9e0-7eeaa2503a5b | 4 | protected void buttonActionPerformed(ActionEvent evt) {
for(JFormattedTextField uiSource: uiSources) {
if(uiSource.isFocusOwner()) {
String text = uiSource.getText().trim();
JButton button = (JButton) evt.getSource();
String key = button.getText();
uiSource.setText(text + key);
if(!key.equals("... |
55206f84-3a66-447a-99b4-3d90df68ae2a | 4 | public void testByteLargeArrayArraycopy()
{
byte[] data = new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int startPos = 2;
int length = 8;
LargeArray.setMaxSizeOf32bitArray(1073741824);
ByteLargeArray a = new ByteLargeArray(data);
ByteLargeArray b = new ByteLargeArray(2 *... |
fb028488-e9cf-43d9-9261-1bde92eedba5 | 8 | public void run() {
Scanner sc = new Scanner(System.in);
while (true) {
String[] command = sc.nextLine().trim().split("\\s+");
String name = command[0].toLowerCase();
if (name.equals("/help") || name.equals("/?")) {
System.out.println("[]===[]===[Commands]===[]===[]\n" +
"/info - displays configu... |
1e06118e-10c3-4afa-8f8d-c75fdb743c12 | 9 | public void killEveryoneHere(MOB spareMe, Room R)
{
if(R==null)
return;
final Vector<MOB> V=new Vector<MOB>();
for(int i=0;i<R.numInhabitants();i++)
{
final MOB M=R.fetchInhabitant(i);
if((spareMe!=null)&&(spareMe==M))
continue;
if((M!=null)
&&(!CMSecurity.isAllowed(M,R,CMSecurity.SecFlag.IM... |
f4d0afac-e0fa-4914-9e7b-b6b45510034e | 7 | public Object nextContent() throws JSONException {
char c;
StringBuffer sb;
do {
c = next();
} while (Character.isWhitespace(c));
if (c == 0) {
return null;
}
if (c == '<') {
return XML.LT;
}
sb = new Str... |
990df99b-d080-4c75-852a-52fbbad66d6a | 3 | @Override
public void selectionDidChange(OutlineModel model) {
Rectangle bounds = repaintSelectionInternal();
if (!bounds.isEmpty() && isFocusOwner()) {
scrollRectToVisible(bounds);
}
if (!(this instanceof OutlineProxy)) {
notifyOfSelectionChange();
}
} |
6b31f87d-185f-4d93-a3db-e3dee335471b | 1 | public static int previousMonth (int month)
{
if (month==1)
return 12;
else
return month-1;
} |
93e6bad8-719a-4061-bd19-ab5f1d2a377c | 4 | public static void splitPivotLastTest(int low, int high) {
exchange(low, high);
int i = low + 1;
for (int j = low + 1; j <= high; j++) {
countLast++;
if (result[j] < result[low]) {
exchange(j, i);
i++;
}
}
exchan... |
a5376819-0138-400c-b6c3-cb8954980096 | 2 | private Integer updateCountry(Criteria criteria, AbstractDao dao) throws DaoException {
Integer idDescription = (Integer) criteria.getParam(DAO_ID_DESCRIPTION);
if (idDescription != null) {
Criteria beans = new Criteria();
beans.addParam(DAO_ID_DESCRIPTION, idDescription);
... |
6bd2fae0-8c36-4a4f-8dd6-88b3f1ba9932 | 6 | public void giveWater() {
if(!dead) {
// 蟇昴※縺溘i襍キ縺阪k
if(sleeping) wakeup();
staycount = 0;
staying = false;
setToFood(false);
toSukkiri = false;
setToShit(false);
shitting = false;
birth = false;
angry = false;
furifuri = false;
setEating(false);
peropero = false;
sukkiri ... |
44685461-1dc2-4376-a531-7b8ac2b9839b | 7 | public void _moveNodes(MindMapNode selected, List selecteds, int direction) {
Comparator comparator = (direction == -1) ? null : new Comparator() {
public int compare(Object o1, Object o2) {
int i1 = ((Integer) o1).intValue();
int i2 = ((Integer) o2).intValue();
... |
1fc20e25-a3ba-4c99-a074-76bef8659900 | 2 | @Override
public void onEnable() {
File dbFile = new File(DatabaseConnector.SAVE_FILE_DIRECTORY + "\\"
+ DatabaseConnector.SAVE_FILE_NAME);
swDataClass = new SWDataClass();
// Check if database file exists
if (!dbFile.exists()) {
// No file, so set one up
getLogger().info("No database file found! Cr... |
a8579184-aa02-4e06-8288-a75517f4a210 | 8 | public Type setType(Type otherType) {
LocalInfo li = getLocalInfo();
if (li.loopCount++ > 5) {
GlobalOptions.err.println("Type error in local " + getName() + ": "
+ li.type + " seems to be recursive.");
Thread.dumpStack();
otherType = Type.tError;
}
Type newType = li.type.intersection(otherType);
... |
91c189ca-c1f6-418f-abce-dfe9a2dbcff1 | 5 | public TreeElement[] getChildrens(TreeElement parent) {
TreeElement[] result = (TreeElement[]) cachedChildrens.get(parent);
if (result == null) {
TreeSet v = new TreeSet();
String prefix = parent == root ? "" : parent.getFullName() + ".";
Enumeration enum_ = ClassInfo.getClassesAndPackages(parent
.get... |
8658dc54-daf5-4d89-b80b-50cc9c4ea262 | 6 | private void initializeMap(String mapFile) {
String line, temp;
int xLoc = 0, yLoc = 0;
int tempx, tempy;
StringTokenizer st;
String delimiters = ";";
// Attempt to read map file
try {
BufferedReader in = new BufferedReader(new FileReader("res/maps/"
+ mapFile + ".txt"));
line = in.readLine();... |
b4367ae9-c531-4521-9bef-895537968651 | 9 | public ArrayList<Solve> selection(ArrayList<Solve> population) {
ArrayList<Double> chances = new ArrayList();
ArrayList<Solve> elitePopulation = new ArrayList();
Random rand = new Random();
int val, imin = 0, sumchance = 0;
int min = Integer.MAX_VALUE;
int max = BestSolve... |
73a151c2-8002-464c-b48d-e0247bc872f1 | 1 | int[] isoFromFixed(long date) {
int weekyear = gjYearFromFixed(date - 3);
if (date >= fixedFromISO(weekyear + 1, 1, 1)) {
weekyear += 1;
}
int weekOfWeekyear = (int)(div(date - fixedFromISO(weekyear, 1, 1), 7) + 1);
int dayOfWeek = (int)amod(date, 7);
return n... |
622a9389-4d1c-4ec3-ba4d-cc5fc1c17cf7 | 1 | public void setConstantValue(final int index) {
if (constantValue != null) {
constantValue.setConstantValueIndex(index);
}
} |
7910b815-0afc-46e7-ad01-5ff31849f227 | 3 | public boolean MouseDownListener(int mX, int mY, int button) {
if(mainLogic.currentState == GameLogic.GameState.PLAYING) {
if(currentMouseAction.onMouseDown(mX, mY, button)) {
return true;
}
for(long a : selectedWeapons) {
GameActor act = main... |
1372d885-f79c-48f7-affb-e88bb6d92037 | 0 | public void setCourse(int course) {
this.course = course;
} |
c4de7410-4348-4ebe-9685-2118cbe402dd | 0 | public void release(T object) {
queue.offer(object);
} |
09d35542-8440-45b2-99cb-a7cbd75bc8e4 | 5 | private void injectHttpSession(Object obj, HttpSession session)
throws Exception {
Class<?> clazz = obj.getClass(); // 객체의 클래스 정보를 가져온다.
Method[] methods = clazz.getMethods(); // 클래스의 메서드 목록을 얻는다.
for (Method m : methods) {
// 목록에서 setXXX() 셋터 메서드를 찾는다.
if (m.getName().startsWith("set")) {
// 셋터 메서드... |
b03272b9-4791-491e-b064-3e68c84a614e | 7 | public void destroy(String id) throws IllegalOrphanException, NonexistentEntityException, RollbackFailureException, Exception {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
Laptops laptops;
try {
lapt... |
fce9cea3-600d-4bf9-9784-0905767c1ebc | 8 | private final void opADCimp(int data) {
int tmp = data + acc + (carry ? 1 : 0);
zero = (tmp & 0xff) == 0; // not valid in decimal mode
if (decimal) {
tmp = (acc & 0xf) + (data & 0xf) + (carry ? 1 : 0);
if (tmp > 0x9)
tmp += 0x6;
if (tmp <= 0x0f)
tmp = (tmp & 0xf) + (acc & ... |
29dfe03c-3fad-42ab-a252-8cf5f19c8b5d | 1 | public void removeComponents(){
for (GameComponent component:components){
Input.inputBus.unregister(component);
}
} |
0b58d530-dbd4-4feb-8910-89d7ce57a0fc | 7 | public boolean testChangeValues( Tester t ) {
Menu menu1 = new Menu( hero0, bombListEMPTY, explosionListEMPTY, rockListEMPTY, scaryListEMPTY, 2, 3, 3, 0, 1 );
Menu menu2 = new Menu( hero0, bombListEMPTY, explosionListEMPTY, rockListEMPTY, scaryListEMPTY, 3, 3, 3, 0, 0 );
Menu menu3 = new Menu( hero0, bombListEMPTY,... |
cb6e38a9-35f4-4dfa-8dd1-bd1d8e9436c5 | 0 | public EncryptedDataType getMACKey() {
return macKey;
} |
2a172a50-2f59-4753-a40c-a3cb51487895 | 7 | @Override
public boolean equals(Object obj) {
boolean result = false;
Cuentas cta = (Cuentas) obj;
if(this == obj) result = true;
if(obj == null || (this.getClass() != obj.getClass()))
result = false;
if ((this.id == cta.id) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.