method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
22c696c9-f84a-46f4-b519-f56aac4a845b | 6 | public void closeConnections() {
try {
if (statement != null) {
if (!statement.isClosed()) {
statement.close();
}
}
} catch (SQLException sqlEx) {
Helper.logException(sqlEx);
}
try {
if (... |
ddba5be3-fa2b-45e2-bf2f-d84766e4abc1 | 9 | public void init(ChatServer server,String args[]){
this.server=server;
ExpirationChecker expirationChecker=new ExpirationChecker(server);
expirationChecker.start();
int serverPort;
try{
serverPort = Integer.parseInt(args[0]);
}catch(Exception e){
serverPort=8000;
}
Runtime.getRuntime().a... |
e4bc6472-405e-40f8-a23a-97a131179c5c | 7 | public int cdlHangingManLookback( )
{
return ((( ((( ((( (this.candleSettings[CandleSettingType.BodyShort.ordinal()].avgPeriod) ) > ( (this.candleSettings[CandleSettingType.ShadowLong.ordinal()].avgPeriod) )) ? ( (this.candleSettings[CandleSettingType.BodyShort.ordinal()].avgPeriod) ) : ( (this.candleSettings[... |
21cb4796-47aa-41ae-b8a7-104b673ca829 | 5 | private static void seqTreatment(String s,String obj){
String [] split = null;
if(s.contains("*")){
split = s.split("\\*");
}else if(s.contains("&")){
split = s.split("\\&");
}
String newComp = "";
HashMap<String,String> hash = new HashMap<String,String>();
for(int i = 0 ; i < split.length ; i++){
... |
4e6a6f43-f9a1-43eb-9fdf-59227f48dd35 | 0 | public ImportingModuleLoader(String pathToBin, ClassLoader parent) {
super(parent);
this.pathToBin = pathToBin;
} |
d68f12d2-3931-4b03-ae4c-a579f73d8482 | 7 | private boolean superSimpleCleanup(String channel, String sender, String message)
{
if (channel.equalsIgnoreCase("#azorae"))
return false;
if (!message.contains(" ") && message.length() >= 150)
{
if (message.startsWith("http") && message.length() < 300)
retu... |
500e8a21-fc65-4076-8d69-48c9f49d4a24 | 3 | @Override
public boolean equals(Object obj){
if (obj instanceof Noeud){
Noeud noeud = (Noeud) obj;
return (noeud.id == this.id) && (noeud.xMetre==this.xMetre) && (noeud.yMetre == this.yMetre);
}
else {
return false;
}
} |
819d1a72-c778-4d47-9474-b49e416c335b | 1 | public void addClassAnalyzer(ClassAnalyzer clazzAna) {
if (parent != null)
parent.addClassAnalyzer(clazzAna);
} |
730a78aa-9453-434b-aed6-6893812e2312 | 1 | @Override
public final Configuration readConfiguration() throws ReaderException {
try {
Configuration config = new Configuration();
Properties properties = new Properties();
FileInputStream configFile;
configFile = new FileInputStream(this.filePath);
properties.load(configFile);
config.setLevel(thi... |
8f67432b-608e-4f59-8d14-61ec5c141924 | 4 | public static Node clone(Node n){
if(n instanceof SETNode){
SETNode res = new SETNode(n.getLabel(),n.getWeight());
res.setWeightAlone(n.getWeightAlone());
res.setType(n.getType());
for(int i = 0 ; i < n.getFils().size() ; i++){
res.getFils().add(ToolNode.clone(n.getFils().get(i)));
}
return ... |
0944fcee-9029-4169-88f6-9af26a88375c | 7 | public String getResourceTotal()
{
int cpu_count = 0;
long memoryAvailable = 0;
long diskAvailable = 0;
try
{
List<String> regionList = ControllerEngine.gdb.getNodeList(null,null,null);
//Map<String,Map<String,String>> ahm = new HashMap<String,Map<String,String>>();
//System.out.println("Region C... |
a933c292-2691-442d-a334-064071d445f1 | 5 | private void makeTableDisplay() {
List<List<String>> table = null;
TableView<Row> tableView = new TableView<>();
tableView.setId("table");
if (!expression.getText().equals("")) {
//switch to handle the selected mode
if (outputMode.equals("Compact")) {
CompactTableGenerator compTable = new CompactTable... |
a4780960-7792-4d6b-9da9-bcdb2361d6fc | 1 | protected MaskFormatter createFormatter(String s) {
MaskFormatter formatter = null;
try {
formatter = new MaskFormatter(s);
} catch (java.text.ParseException exc) {
System.err.println("formatter is bad: " + exc.getMessage());
System.exit(-1);
}
... |
263a275e-2cff-44a6-8770-ab423976a001 | 8 | private void readData()
throws IOException
{
while (! isClosed) {
int code = is.read();
switch (code) {
case ' ':
case '\t':
case '\n':
case '\r':
break;
case 'C': {
int channel = (is.read() << 8) + is.read();
inputReady[channel] = true;
... |
21deb2da-98c8-425d-b890-354e89a23fa1 | 0 | @Override
public void onStringInput(String input) {
System.out.println("User input: " + input);
} |
da5fb6a3-061d-4c09-b5f0-1446b00fe782 | 4 | public static void writeFile(String fileName) {
if (fileName == null) // Go back to reading standard output
writeStandardOutput();
else {
PrintWriter newout;
try {
newout = new PrintWriter(new FileWriter(fileName));
}
catch (Exception e) {
... |
2a2e2887-37ca-4b3e-9462-5449ff1c0338 | 0 | public void setStartDate(XMLGregorianCalendar value) {
this.startDate = value;
} |
71c435c3-a55c-473d-aedd-bacdf44a32c5 | 1 | public static void killme(int num) {
if (SH.containsKey(num)){
SH.get(num).interrupt();
}
} |
e96f72e0-3f57-412c-aaec-60adfe2f1758 | 9 | static final boolean method2547(int i, byte i_0_) {
anInt3993++;
if (Class163.aBooleanArray2162[i])
return true;
if (!Class229.aClass45_2978.method408(i))
return false;
int i_1_ = Class229.aClass45_2978.getAmountChildEntries(i);
if (i_1_ == 0) {
Class163.aBooleanArray2162[i] = true;
return true... |
4d19b143-4b15-4893-b4ac-b6f5799edcd8 | 3 | public static Pair<BigInteger, BigInteger> sign(boolean deb,
String message, BigInteger publcG, BigInteger publicP,
BigInteger publicQ, BigInteger privateX) {
debug = deb;
debugMode("=== CREATING SIGNATURE ===", true);
// K
debugMode("Creating auxiliar variable K .......... ", false);
BigInteger k = ne... |
77543575-9c2c-4247-a78c-587a3436e396 | 7 | public int[][] getUsedAttributes(){
int[][] usedAttributes = new int[m_numClasses][];
//first extract coefficients
double[][] coefficients = getCoefficients();
for (int j = 0; j < m_numClasses; j++){
//boolean array indicating if attribute used
boolean[] attributes = new boolean[m_numericDataH... |
5508eca9-9be8-401e-aa27-ba22b4f01c67 | 4 | public void setMacro( String macro )
{
if( cxnSp != null )
{
cxnSp.setMacro( macro );
}
else if( graphicFrame != null )
{
graphicFrame.setMacro( macro );
}
else if( sp != null )
{
sp.setMacro( macro );
}
else if( grpSp != null )
{
grpSp.setMacro( macro );
}
} |
ef146eb1-e786-4938-aff8-45bd21b33185 | 8 | public void deleteTags(String filePath){
PictureI picture = findById(filePath);
if(picture != null){
try{
List<? extends TagI> taggs = picture.getTags();
List<Tag> tags = new ArrayList<Tag>();
for(TagI t: picture.getTags())
tags.add((Tag) t);
beginTransaction();
for(TagI tag: tags){
... |
e88332c2-9bae-406d-bb3c-803467b522d2 | 2 | public int[][] getActualGrid()
{
int[][] gridActual = new int[sudokuSize][sudokuSize];
for (int i = 0; i < sudokuSize; i++) {
for (int j = 0; j < sudokuSize; j++) {
gridActual[i][j] = cells[i][j].current;
}
}
return gridActual;
} |
2040be41-399e-4c9f-bebd-561c97c74cb0 | 6 | public void initialisieren()
{
this.anzSpieler = -1;
while ( this.anzSpieler < 0 || this.anzSpieler > 4 )
{
Anzeige.zeigeStringAn( "Anzahl der Spieler ( 0 bis 4 ) eingeben:" );
try
{
this.anzSpieler = Integer.parseInt( getEingabe() );
}
catch ( NumberFormatException nfEx )
{
System.out... |
7115a8ba-d55f-4dec-9feb-1acb9894080c | 7 | public static void main(String[] args) throws LexerException, IOException {
// TODO code application logic here
Reader r;
try {
for (int i = 0; i < args.length; i++) {
r = new FileReader(args[i]);
MyLexer l = new MyLexer(new PushbackReader(r));
... |
4178e634-8bde-4f13-8f47-81469bd497d9 | 0 | protected String addTopGameFeatures(JButton b)
{
b.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
myMDisplay.setText("");
updateTopPane(false);
reset();
... |
77f208c1-84c0-4abc-b621-935c0f573229 | 1 | public void start() {
if (gameStatus.equals(GameResult.MafiaWins)) sendMafiaWinsMessage();
else sendVillagerWinsMessage();
close();
} |
f4f8fa7e-7909-4d45-8da1-34be1b653ab0 | 1 | @Override
public void save(Object o) throws Exception {
try {
session = obtainSession();
session.beginTransaction();
session.update(o);
session.flush();
session.getTransaction().commit();
} catch (HibernateException e) {
session... |
9badc53a-0c48-48f1-ba3d-65d63aca1039 | 2 | protected void runProgram (List<String> args)
throws IOException, InterruptedException {
logger.entering(getClass().getName(), "runProgram", args);
ProcessBuilder procBuilder = new ProcessBuilder(args);
Process proc = procBuilder.start();
proc.waitFor();
// E... |
9966d800-83c4-40e4-ace9-9141749f03fb | 4 | private List<ExternalContent> getExpandedExternalContents(final Request request) {
final List<ExternalContent> externalContents = request.getExternalContents();
final List<Variable> contextVariables = workflow.getContext().getVariables();
for (final ExternalContent eContent : externalContents) {
print("Exte... |
bd26f9c2-af0e-4786-baf4-9bd4f4f8b109 | 7 | public void propertyChange(PropertyChangeEvent e) {
File selectedFile = fc.getSelectedFile();
if(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY.equals(e.getPropertyName()) && selectedFile!=null) {
preview = new ImageIcon(selectedFile.getPath());
if(preview == null)
r... |
dec047c0-45c6-4b72-b59c-83ceb6ef24fd | 8 | @SuppressWarnings({ "incomplete-switch", "deprecation" })
@EventHandler
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
if (!(event.getEntity() instanceof Player)) {
return;
}
if ((event.getDamager() instanceof Player)) {
switch (event.getEntityType(... |
7f558dac-180a-47fb-b2cc-52ce7375c8fc | 6 | public String createTable(List<ColumnInfo> cols, PrimaryKey pk, List<Index> uis, Partitioning partitioning) {
if (null == cols || 0 == cols.size()) {
throw new RuntimeException("建表时必须至少包含一列!");
}
StringBuilder sb = new StringBuilder();
cols.stream().forEach((col) -> {
sb.append(',').append(col.toString())... |
b8e80072-2eb2-492c-9a99-d8dbe103e2ed | 8 | public void mouseReleased(MouseEvent e)
{
if (mode == Mode.DRAW) // in DRAW mode, create the new box
{ // and add it to the list of shapes
int wid = Integer.parseInt(JOptionPane.showInputDialog(
theWindow,"Enter the width"));
int ht = Integer.parseInt(JOptionPane.showInputDialog(
... |
f1c8d532-ea79-4ee2-8d58-006de1cf5c1f | 1 | public String toString() {
return this.mode == 'd' ? this.writer.toString() : null;
} |
1d329d46-b310-44a2-a354-1dc008237521 | 3 | public void refresh()
{
try
{
int i = mySlider.getValue();
if(i > myMax)
i = myMax;
if(mySlider.getValue() < myMin)
mySlider.setValue(myMin);
myDisplay.setText(myText.substring(myMin, i));
myLengthDisplay.set... |
305c2eda-aa4c-4de2-a33c-aa1ee44f1008 | 8 | public static int costFunction(TetrisBoard TB, int i, int j, int k, boolean DEBUG) {
if (DEBUG) {
System.out.println("cost fn ("+i+", "+j+", "+k+")");
TetrisBoard.printTetromino(i);
}
int cost = Integer.MAX_VALUE;
int ret = TB.dropTetromino(i,j,k,TB.tilemarker);
if (ret >= 0) {
... |
e1f772ac-9d70-4639-b98b-e085e126c95f | 0 | public CheckResultMessage check24(int day) {
return checkReport.check24(day);
} |
69e06f90-8488-404d-a931-02342ed2fcf5 | 4 | public void SpecDamg(int maxDamage) {
for (Player p : server.playerHandler.players)
{
if(p != null)
{
if (PlayerHandler.players[AttackingOn].IsDead == false ) {
int damage = misc.random(maxDamage);
if (PlayerHandler.players[AttackingOn].playerLevel[3] - hitDiff < 0)
damage = PlayerHand... |
400a70e1-da26-44fe-9128-ad4a4bbddb5b | 7 | public static HandshakeBuilder translateHandshakeHttp( ByteBuffer buf, Role role ) throws InvalidHandshakeException , IncompleteHandshakeException {
HandshakeBuilder handshake;
String line = readStringLine( buf );
if( line == null )
throw new IncompleteHandshakeException( buf.capacity() + 128 );
String[] f... |
d7520e29-e320-44be-a0e6-a6f7b7c99e27 | 7 | public void render(Tesselator tess, int i, int j, int k, Level level) {
if(icon[0] < 0) return;
boolean xm = !level.getBlock(i - 1, j, k).solid, xp = !level.getBlock(i + 1, j, k).solid;
boolean ym = !level.getBlock(i, j - 1, k).solid, yp = !level.getBlock(i, j + 1, k).solid;
boolean zm = !level.getBlock(i, j, ... |
67598d3a-7e4c-4088-ac40-6432c0aaa671 | 4 | public static void usePokeBall(Item item)
{
if (!hasItem(item))
{
errorWindow.addMessage(" You don't have this item in your inventory to use! ");
errorWindow.toFront();
return;
}
if (!Battle.BATTLE_TYPE.equals("WILD"))
{
errorWindow.addMessage("You can't steal a Trainer's Pokemon!");
errorWin... |
01d0a0b1-65a4-44c2-8db9-532cfd3a1706 | 7 | public String getColumnName( int col )
{
String back = "-" ;
if ( col == 0 ) // status column
{
back = "" ;
}
else if (col == 1)
{
back = "ref" ;
}
else if ( col == KEY_COLUMN ) // key
{
back = "key" ;
}
else // language column
{
// is a default ... |
c45ca715-5fc2-4740-af10-daa72d1a7d75 | 0 | @Override
public boolean supportsComments() {return true;} |
bcfc628c-204c-404d-9454-2d813b4bbe78 | 2 | public StructuredBlock getNextBlock(StructuredBlock subBlock) {
if (subBlock == subBlocks[0]) {
if (subBlocks[1].isEmpty())
return subBlocks[1].getNextBlock();
else
return subBlocks[1];
}
return getNextBlock();
} |
ef336284-c276-435c-a399-1aeded991e3b | 4 | public void appendBytes(byte...datas){
this.isBuffered.set(true);
ByteBuffer buffer = this.getBuffer();
if(buffer.remaining() >= datas.length){// 缓冲区的空间大于数据的长度
buffer.put(datas);
log.info("the postion of the data: " + buffer.position());
}else{// 缓冲区的空间小于数据的长度
int offset = 0;// 初始相对位移为0
int length =... |
eb7a8c56-0500-461a-8de9-39ea4f9afa74 | 5 | protected BufferedImage initOffsets() {
BufferedImage img = image;
if( img == null ) return img;
scale = 1;
while( img.getWidth() * scale > getWidth() || img.getHeight() * scale > getHeight() ) {
scale /= 2;
}
while( img.getWidth() * scale * 2 <= getWidth() && img.getHeight() * 2 <= getHei... |
e1335fce-c56b-4ed6-956f-2a0b3b1fa222 | 1 | public void printList(List<Integer> list) {
for (int elm : list)
System.out.print(elm + "=>");
System.out.println("EOL (length:" + list.size() + ")");
} |
6ee66627-c373-42da-9a3e-44366451bf30 | 0 | public DragonBoneSword(){
this.name = Constants.DRAGONBONE_SWORD;
this.attackScore = 15;
this.attackSpeed = 19;
this.money = 1500;
} |
d77cc568-e5e9-4a6c-ac8f-ecf1a7eca5a2 | 8 | public ProcessTextArea(final JTextArea area, ProcessBuilder processBuilder) {
super(area);
this.processBuilder = processBuilder;
close = new JButton("Terminate");
close.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
closeProcess();
}
});
addT... |
b5414ef0-1cbe-4dff-ab3c-2f27eadab622 | 8 | public void deleteSelectedItem()
{
// DELETE THE SELECTED INTERSECTION, BUT MAKE SURE IT'S
// NOT THE STARTING LOCATION OR DESTINATION
if ((selectedIntersection != null)
&& (selectedIntersection != level.startingLocation)
&& (selectedIntersection != level.des... |
02bf4bcf-59d1-4d47-83b9-f475af9d86a1 | 5 | public List<Integer> postorderTraversal1(TreeNode root) {
if (root == null) return list;
Stack st = new Stack();
Stack st2 = new Stack();
st2.add(root);
while(!st2.isEmpty())
{
root = (TreeNode) st2.pop();
st.push(root);
if (root.left != null)
st2.push(root.left);
if (root.right !=... |
398120ab-2c0c-49ee-8297-72727e4ce9a8 | 3 | public static void main(String[] args) {
// TODO Auto-generated method stub
DataModel model = null;
try {
model = new FileDataModel(new File("/home/naren/projects/minhash/intro.csv"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
UserSimilarity similarity;
t... |
26c1d29f-cc17-4eb7-acd9-5e44dc1a50f4 | 7 | public void sort(int low, int high) {
if(low >= high)
return;
int i=low+1, j=high;
int pivotIndex = low;
while(i<=j) {
// i,j comparison should come first
while(i<=j && array[i] <= array[pivotIndex])
i++;
while(j>=i && array[j] > array[pivotIndex])
j--;
if(i<=j) {
swap(i, j)... |
f1e8a119-7066-4cb4-8c78-b85e434d3aab | 6 | public Object callMethod(Object o, String methodName, Object... args)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
Method method = null;
if (args == null || args.length == 0) {
method = o.getClass().getDeclaredMethod(methodName);
} else {
Class<?>... |
f66312fe-3eb0-4127-bf09-bf3f9fd9176c | 2 | public void send(Object message) {
if (isOpen) {
try {
out.writeObject(message);
out.flush();
} catch (IOException e) {
statusMessage("Error writing object to stream");
e.printStackTrace();
errorCloseClient("Error writing object to stream");
}
}
} |
b06528b2-660a-4ae0-905c-cfe84b7c6a0c | 3 | public <I extends Item> void addConverter( Class<I> itemType, Class<? extends ItemKey<I>> keyType, DataConverter<I, ? extends Data<I>, ? extends DefaultItem<I>> converter ) {
convertersByItemType.put( itemType, converter );
convertersByKeyType.put( keyType, converter );
} |
d33292fc-7438-481d-aea7-60caebe9954f | 9 | protected void FillBuff() throws java.io.IOException
{
if (maxNextCharInd == available)
{
if (available == bufsize)
{
if (tokenBegin > 2048)
{
bufpos = maxNextCharInd = 0;
available = tokenBegin;
}
else if (tokenBegin < 0)
bufpos = maxN... |
88eb3a28-829f-4d3e-8421-d6241a25ae31 | 1 | public static int getInteger() throws BadInput {
int num;
try {
String str = getString();
num = Integer.parseInt(str);
} catch(NumberFormatException e) {
throw new BadInput();
}
return num;
} |
dfe1499d-7ace-4e0a-8dae-385b2778260f | 9 | public static int ladderLength(String start, String end, HashSet<String> dict) {
dict.add(start);
dict.add(end);
HashMap<String, Pair> visitMap = new HashMap<String, Pair>();
for (String w : dict) {
if (w.equals(start)) {
visitMap.put(start,new Pair(false,w, ... |
c2b95c02-fb05-4e0a-9acc-ac168d3ddeb5 | 9 | protected void FillBuff() throws IOException {
if (maxNextCharInd == available) {
if (available == bufsize) {
if (tokenBegin > 2048) {
bufpos = maxNextCharInd = 0;
available = tokenBegin;
} else if (tokenBegin < 0) bufpos = maxN... |
fce94671-db59-4b13-893a-e4b71f2e9ea8 | 3 | public static ArrayList<bConsulta> getListaGMP(String dt1) throws SQLException, ClassNotFoundException {
ArrayList<bConsulta> sts = new ArrayList<bConsulta>();
Connection conPol = conMgr.getConnection("PD");
if (conPol == null) {
throw new SQLException("Numero Maximo de Conexoes Atin... |
7a503415-ce5f-4ee8-8b97-86c8a6151f6f | 3 | public boolean compareToLoc(Location loc)
{
if(loc.getBlockX() == x && loc.getBlockY() == y && loc.getBlockZ() == z)
{
return true;
}
else
{
return false;
}
} |
bc490fab-6946-4f78-b552-65f74b5af2eb | 0 | public Region(int x,int z,Dimension dim){
this.x = x;
this.z = z;
this.dim = dim;
} |
06ecfe59-8edf-46c7-a9b6-c3c695e52139 | 5 | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof TaxonDataset)) {
return false;
}
TaxonDataset other = (TaxonDataset) object;
if ((this.datasetKey == null && ot... |
feba43a7-f62d-4945-a51a-4acd489daadc | 1 | @Override
public void draw() {
spellWindow.draw();
weaponWindow.draw();
if(confirmationWindow != null)
confirmationWindow.draw();
} |
12f03fd5-4370-464e-b3d3-6fe02ba56cfb | 2 | private static int getTypeInt(TiffType type) {
switch (type) {
case SHORT:
return 3;
case LONG:
return 4;
default:
throw new IllegalArgumentException();
}
} |
d0281373-d4df-45e6-86d8-8b71e65aba99 | 5 | private List<String> expandDynamicArg(String arg)
{
for (ParameterDescription pd : m_descriptions.values())
{
if (pd.isDynamicParameter())
{
for (String name : pd.getParameter().names())
{
if (arg.startsWith(name) && !arg.equals(name))
{
return Arrays.asList(name, arg.substring(name.l... |
909bf2c6-5a5b-4ef8-8ee0-8c0ff9a0ffd5 | 0 | public void setjLabelSecteur(JLabel jLabelSecteur) {
this.jLabelSecteur = jLabelSecteur;
} |
c7e5041d-cdd7-4ab3-829e-dd91eb7b0d22 | 0 | public void setFinishedById(Integer id, boolean isFinished) {
String query = "UPDATE Step SET isFinished = :isFinished WHERE id = :stepId";
sessionFactory.getCurrentSession().createQuery(query)
.setInteger("stepId", id)
.setBoolean("isFinished", isFinished)
... |
3e627c53-c222-43a5-9ad5-c557d87a8ec8 | 7 | @Override
public void add(LessFileStatus lfs) {
//System.out.println("ADD " + lfs.getLessName());
synchronized (LOCK_MODEL) {
// - Compute sortedIndex
int sortedIndex, sortedLen = sortedLFS.size();
for (sortedIndex = 0; sortedIndex < sortedLen; sortedIndex++) {
LessFileStatus item = sortedLFS.get(sorted... |
5f875724-ca87-4bab-93e6-72c43ab65a26 | 8 | public IPlugin getPlugins(int param) throws IllegalArgumentException {
IPlugin plugins = null;
switch(param) {
case 0:
plugins = null;
break;
case 1: // HTTP(S) Proxy + Header Dumper + Header Changer with Deactivate-Compression plugin and HTTP 1.0 plugin
plugins = new He... |
7a81cbba-b365-473b-a3f1-b72de8949b13 | 0 | private MoveButtonPanel() {
super();
ActionListener buttonListener = new ButtonMoveListener();
this.setLayout(new GridLayout(3, 3)); // grid layout
this.setPreferredSize(new Dimension(75, 50)); // set size
/* Create the arrow buttons */
up = new BasicArrowButton(SwingConstants.NORTH);
down = n... |
15027cf0-aec8-48cc-a996-bc3955007b3c | 6 | private int jjMoveStringLiteralDfa7_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(5, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(6, active0);
return 7;
}
switch(curChar)
{
case 32:
... |
c8cb495c-59c0-4fc4-8e51-fbbdfa99b193 | 2 | public void resume() {
for(int x = 0; x<soundEffects.size(); x++) {
soundEffects.get(x).getClip().resume();
}
for(int x = 0; x<tracks.size(); x++) {
tracks.get(x).getClip().resume();
}
background.getClip().resume();
} |
c415150f-9a3d-4436-a88c-f082cc143e77 | 7 | public static boolean putMoney(int money) {
Utils.getString("city/index");
Control.quietSleep(500);
Utils.getString("sparkasse/banker");
Control.quietSleep(500);
String einzahlen = Utils.getString("sparkasse/einzahlen");
Control.quietSleep(500);
if (money == 0) {
List<NameValuePair> nvps = new Arr... |
63560761-3a46-43b7-896d-9277869b0ad5 | 0 | public Menu() {
initComponents();
//Se crea el archivo "txt"
String archivo = "Reistro.txt";
File f = new File(archivo);
} |
8fcfa84f-9e70-4bea-b6d1-752155e1d22a | 1 | public void usingKeySet(Map<Integer, String> map){
for(Integer key: map.keySet()){
System.out.println("Key: "+key);
}
} |
ab567208-e93e-40d4-a338-5f972404f536 | 3 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Player other = (Player) obj;
if (!Objects.equals(this.username, other.username)) {
return fal... |
965c0df8-1cf4-4682-8bf4-a53a4f1b6b55 | 9 | public static void main(String[] args) throws IOException, JDOMException {
Map<String, String> propertiesMap = readProperties(args);
if (!propertiesMap.containsKey("method") || !propertiesMap.containsKey("file")){
System.out.println("Miss properties (file | method)");
System.out.println("java -jar TreeVis... |
345a4775-3b93-4c76-8ad6-0bbf893164e2 | 7 | private void startDealing() {
Method[] mm = dealer.getClass().getDeclaredMethods();
for(Method m : mm){
System.out.println(m);
}
dealerThread = new Thread(new Runnable() {
@Override
public void run() {
try {
maintainDealer();
} catch (NoSuchMethodException e) {
// TODO Auto-generated... |
5889db67-c2f6-4e1d-bacb-d00c9c8c3eb0 | 2 | public static Resource getResourceInstance(String domainName, String path){
Resource reuturnedResource =null;
if(path.contains(".css")){
reuturnedResource = new CSS(domainName, path);
}else if( path.contains(".js")){
reuturnedResource = new JS(domainName, path);
}
else{
reuturnedResource = new Page(... |
1ec6b747-d66d-434e-9736-7c8e5e48318f | 7 | private static <A extends Annotation> A getAnnotationOnProperty(PropertyDescriptor propertyDescriptor, Class<?> javaType, Class<A> annotationType) {
Method setter = propertyDescriptor.getWriteMethod();
Method getter = propertyDescriptor.getReadMethod();
if (setter.isAnnotationPresent(annotationType) && gett... |
c4aa839b-4222-4fd7-a564-d57aabb70b5d | 6 | public void visitBaseType(final char descriptor) {
if (type != TYPE_SIGNATURE || state != EMPTY) {
throw new IllegalStateException();
}
if (descriptor == 'V') {
if (!canBeVoid) {
throw new IllegalArgumentException();
}
} else {
... |
d1e06032-d6a5-4e93-a0dc-299230132e7d | 9 | public static Mitgliedstyp fromString(String str) {
switch (str) {
case "Mitglied":
case "MITGLIED":
return MITGLIED;
case "Nicht-Mitglied":
case "Nicht Mitglied":
case "NICHT_MITGLIED":
return NICHT_MITGLIED;
case "Schnuppermitglied":
... |
09b1ed5c-ba65-43a8-8cb2-2c0356debd18 | 2 | void turn() {
if (whichIndex == 0) {
whichIndex = 1;
step = step * -1;
}
else {
whichIndex = 0;
}
max[whichIndex]--;
if (max[whichIndex] <= 0)
closed = true;
} |
90fedd0f-e423-4164-acae-18d359379f65 | 1 | public boolean Insertar(Object o) {
Transaction t = cx.beginTransaction();
try {
cx.save(o);
t.commit();
cx.flush();
return true;
} catch (Exception e) {
System.out.println("no se inserto");
t.rollback();
return... |
aa497d2b-8bbc-4460-9972-713bc7b80262 | 9 | static final void method3808(boolean bool, int i) {
anInt4075++;
for (Node_Sub47 node_sub47 = (Node_Sub47) Class290_Sub6.aClass312_8122.method3613(65280); node_sub47 != null; node_sub47 = (Node_Sub47) Class290_Sub6.aClass312_8122.method3620(16776960)) {
if (node_sub47.aNode_Sub9_Sub2_7568 != null) {
Class176... |
c21b21fb-c043-49d1-add1-507d026380a1 | 0 | public boolean getHasVisited() {
return hasVisited;
} |
0d22354a-5394-476b-81d7-801ab4cf72ac | 8 | public static int countNeighbours(boolean[][] world, int col, int row) {
int c = 0;
if (getCell(world, col - 1, row - 1) == true) {
c += 1;
}
if (getCell(world, col, row - 1) == true) {
c += 1;
}
if (getCell(world, col + 1, row - 1) == true) {
c += 1;
}
if (getCell(world, col - 1, row) == tr... |
62d2777f-ab09-44a3-8c3c-665044254a3a | 8 | @Override
public void keyPressed(KeyEvent e) {
int id = e.getKeyCode(); //KeyCode des KeyEvents auslesen
// Mittels KeyEvent prüfen, was für eine Taste gedrückt wurde, Wahrheitswert setzen
switch (id) {
case (KeyEvent.VK_W):
if(!CollideTop) {
figUp = true;
}
break;
case (KeyEvent.VK... |
6ec712c0-6c76-4e83-8754-99fb926ca1fd | 9 | public void addNamespace(int nscode) throws XPathException {
if (localNamespaces == null) {
localNamespaces = new int[]{nscode, -1, -1, -1};
}
for (int n=0; n<localNamespaces.length; n++) {
int nn = localNamespaces[n];
if (nn == nscode) {
retur... |
e82bc46b-dd95-41a9-a581-92bee833c69f | 8 | @Override
public void messageReceived(IoSession session, Object message) {
Logger log = LoggerFactory.getLogger(ChatProtocolHandler.class);
log.info("received: " + message);
String theMessage = (String) message;
String[] result = theMessage.split(" ", 2);
String theCommand = ... |
c622e4d0-a594-489b-b020-7c7b3706c4e4 | 9 | public JsonObject toJsonObject() {
JsonObject json = new JsonObject();
json.add("id", id);
if ( stdin != null ) json.add("stdin", stdin);
if ( stdout != null ) json.add("stdout", stdout);
if ( stderr != null ) json.add("stderr", stderr);
if ( status != null ) json.add("status", status);
if ( error != n... |
6c0eb26a-b53e-4c7e-abff-7fa0851c5114 | 0 | public Image getImageMetadatabyId(String id) {
return imageTemplateRepository.getImageMetadatabyId(id);
} |
44a01756-f77a-4c12-879a-cffb1441c644 | 2 | private static int getFreeSlots(InventoryItem[] targetInventory)
{
//counter variable
int count = 0;
//Scan the targetInventory looking for EmptyItem's
for(int i = 0; i<targetInventory.length; i++)
{
//if it finds one, increment the counter variable.
if(... |
af8f11a0-f13e-4237-819c-0a414eae82d1 | 1 | public void playUnit() throws InterruptedException{
try
{
in = new FileInputStream(unit);
as = new AudioStream(in);
ap.player.start(as);
}
catch(Exception e)
{
System.out.println("Got an IOException: " + e.getMessage());
e.printStackTrace();
... |
e0664fbd-e4d0-49c5-b2ad-099111a2b9e9 | 4 | private void genUi(int userId) {
int userRatedNumber = DataInfo.userlist[userId].length; //用户评过分的项目个数
if (userRatedNumber == 0) {
for (int j = 0; j != DataInfo.featureNumber; j++) {
DataInfo.userFeature[userId][j] = 0;
}
return;
}
int[] columnIndexes = new int[userRatedNumber];
dou... |
a88e6ace-473a-4db8-98a5-f39931e8300f | 1 | public Node getPrevious() {
Node node = current;
if (node == head) {
current = null;
return null;
}
current = node.previous;
return node;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.