method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
51e018cd-dee8-4786-a138-2912e621e34c | 1 | private static long normalize(int value) {
return (value >= 0) ? value : (~0L >>> 32) & value;
} |
ec3d5c4e-8e71-4b79-b61d-27d8eac3bc0a | 5 | public List<Employee> getCoWorkers(int id, String name){
if (name == null) throw new IllegalArgumentException();
TreeNode e = find(id, name);
if (e == null) return null;
List<Employee> coWorkers = new ArrayList<Employee>();
if (e.getSupervisor() != null) {
for (TreeNode n: e.getSupervisor().getWorkers()) {... |
30e03f98-893e-4a17-8d9b-10afe0c11611 | 6 | private boolean findMatch(String searchString, TableItem item, int column, boolean matchWord, boolean matchCase) {
String tableText = matchCase ? item.getText(column) : item.getText(column).toLowerCase();
if (matchWord) {
if (tableText != null && tableText.equals(searchString)) {
return true;
}
} else {
... |
a7567b99-43ff-464a-ba6f-105eef6feb8d | 4 | final Object preformatInternal(Object value) {
if (value == null) {
return null;
} else if (getDepth() > getMaxDepth()) {
return null;
} else if (JSON.this.getClass() != JSON.class) {
try {
return preformat(this, value);
} catch (Exception e) {
throw new JSONException(getMessage("json... |
cbc719e4-5a69-4100-b6b9-f5c73f12b1fb | 3 | public Color getColor(String name) {
Color clr = cachedColors.get(name);
if (clr != null)
return clr;
String str = settings.get(COLOR + name);
if (str == null) {
System.err.println("No color defined: " + name);
return Color.gray;
}
try {
clr = new Color(Integer.parseInt(str, 16));
} catch (Num... |
8a358cd0-63d9-41d2-952a-f74637fdf97e | 8 | public static BitSet typeToSet(final Type type) {
final BitSet v = new BitSet(ClassHierarchy.MAX_INT);
int lo;
int hi;
if (type.equals(Type.INTEGER)) {
lo = ClassHierarchy.MIN_INT;
hi = ClassHierarchy.MAX_INT;
} else if (type.equals(Type.CHARACTER)) {
lo = ClassHierarchy.MIN_CHAR;
hi = ClassHier... |
2875cec4-e72c-4a9f-b943-c43d82da79d0 | 7 | private int countAdjacentMines(int row, int col) {
int adjacentMines = 0;
for (int i = row - 1; i <= row + 1; i++) {
for (int j = col - 1; j <= col + 1; j++) {
if (i >= 0 && i < rows && j >= 0 && j < cols
&& field[i][j].hasMine())
adjacentMines++;
}
}
return adjacentMines;
} |
891171cd-53fa-4fdb-bd8d-1ccd9c12507c | 3 | public ServeurEcho (String tab[])
{
if(tab.length == 1)
{
try
{
int p = Integer.parseInt(tab[0]);
SetPort(p);
}
catch (Exception e) { System.out.println("Numero de port non valide, fermeture du serveur"); }
... |
f02a5bd8-96a8-4300-bd4d-b6b472c04c76 | 4 | protected double reCalCenters(Map<Integer, float[]> centerMap) {
int dimensionNum = centerMap.get(0).length;//获取维数
// centerList.clear();
double changeSum = 0;//统计各中心位移的总和
for (int i = 0; i < clusterNum; i++) {
//按簇类遍历
ArrayList<IClusterCalculable> calculableArrayL... |
3eb460b1-a0e8-4ecf-90cf-58e3a0e98c48 | 1 | public void printOverzicht(){
int i = 1;
for (Huisdier dier : lijst){
System.out.println("Naam dier" + i + ": " + dier.getNaam());
i ++;
}
} |
556d2554-be45-4f2a-86c6-4f34e762e4c0 | 4 | protected static Ptg calcAsinh( Ptg[] operands )
{
if( operands.length != 1 )
{
return PtgCalculator.getNAError();
}
double x = 0.0;
try
{
x = operands[0].getDoubleVal();
}
catch( NumberFormatException e )
{
return PtgCalculator.getValueError();
}
if( new Double( x ).isNaN() ) // Not a N... |
23ad12cf-e734-4725-bfa9-c420dccebefd | 6 | private static void agregarCuenta() {
do{
try{
System.out.println("Tipo de Cuenta? A (ahorro) o C (Cheque): ");
char tipo = lea.next().charAt(0);
System.out.println("Codigo: ");
int n = lea.nextInt();
System.out.println... |
1d42ddf2-3719-4436-aeaa-52eada4a53c3 | 2 | public static int GetOnCount(int value, int length){
String binary = DecimalToBinary(value, length);
char[] binaryChar = binary.toCharArray();
int count = 0;
for(int i = 0; i < binary.length(); i++){
if(binaryChar[i] == '1'){
//return count;
//}
count+... |
4387d922-468b-48e9-95ed-862fdf71c262 | 3 | public Graph create( ArrayList<Pair> pairs, int numVersions )
throws Exception
{
unattached = new UnattachedSet();
incomplete = new HashSet<Node>();
allVersions = new BitSet();
for ( int i=1;i<=numVersions;i++ )
allVersions.set( i );
graph = new Graph();
origSize = pairs.size();
if ( pairs.size() > ... |
4b38b452-85db-4797-b351-2bac94e396bc | 1 | @Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.DESELECTED){
_view.edt_ID.setVisible(true);
} else {
_view.edt_ID.setVisible(false);
_view.edt_ID.setText("");
_view.edt_cfirstname.se... |
d43fef38-f4af-4412-be6f-c4a17f5119b3 | 7 | @Override
public void actionPerformed(ActionEvent e) {
JButton button = (JButton) e.getSource();
if (button == jbnChangePass) {
if (jtfNewPass.getText().equals("") || jtfConfirmNewPass.getText().equals("")) {
JOptionPane.showMessageDialog(null, "Please, fill all empty fi... |
d1a31a61-fe64-4781-ae31-acd3bfcdaa57 | 1 | @Override
public void createTheme(SubTheme subTheme) {
if (subTheme != null) {
Session currentSession = getCurrentSession();
currentSession.saveOrUpdate(subTheme);
}
} |
9a1269ba-6780-48e6-9e73-71fe3ca0ca89 | 9 | @Override
protected void doSaveRecordAction() {
@SuppressWarnings("rawtypes")
ListView l;
final ListAddress listAddress;
// Add the other lists to the JPanel and register with the layout
this.otherListsContainer.add(listAddress = new ListAddress(
this.splitPane, this, this.customer, this.customer.g... |
15c7f354-ad1f-4f52-ab3b-8f7754254cd2 | 7 | public boolean calcWeights() {
boolean allAtMin = true;
double total = 0;
if (this.getAlpha() != 0.0) {
for (int i=0; i < this.trackLocsByIndex.length; i++) {
Integer location = this.trackLocsByIndex[i];
this.sickEdgeWeight[i] = this.calcUnNormWeight(location);
total += this.sickEdgeWeight[i];
... |
b7580838-66b9-444e-9160-e7ae19bf8b56 | 4 | public void visitStackManipStmt(final StackManipStmt stmt) {
for (int i = 0; i < stmt.target.length; i++) {
if (stmt.target[i] == from) {
stmt.target[i] = (StackExpr) to;
((Expr) to).setParent(stmt);
return;
}
}
for (int i = 0; i < stmt.source.length; i++) {
if (stmt.source[i] == from) {
... |
2fe5a7b3-8913-4c06-beef-24ddd76599d1 | 4 | void setTopControl (int index) {
if (index == -1 || children.length == 0) {
currentLayer = -1;
topControl.setText ("");
} else {
currentLayer = index;
stackLayout.topControl = children [currentLayer];
layoutComposite.layout ();
TableItem item = table.getItem(currentLayer);
topControl.setText (i... |
9bba4b59-b2fc-4599-84bd-5b67b4f6f55c | 0 | @Test
public void test_AddTwoNegitives() {
assertEquals("FAILED: test_AddTwoNegitives", simpleObject.add(-1,-2), -3);
} |
26935a66-334c-46d3-933c-50d31f91aba0 | 2 | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
OrderService orderService = (OrderService) getServletContext().getAttribute("orderService");//呼叫service
BookService bookService = (BookService) getServletContext().g... |
bbe58cf1-8b4c-4e5e-a016-d96df8b33823 | 8 | public static Tile[][] getTiles(String filePath) {
// Set up the input, which Java makes require a stupid number of
// classes.
FileInputStream inputStream;
try {
inputStream = new FileInputStream(filePath);
} catch (FileNotFoundException e) {
throw new IllegalArgumentException("Could not load map " + f... |
e876e0e0-2a60-4ab6-8ba2-55df6d5ce621 | 3 | public void loadSignals() {
final String signalsFilePath = dlgSignals.open();
if (signalsFilePath != null) {
Yaml yaml = new Yaml();
InputStream stream = null;
try {
stream = new FileInputStream(signalsFilePath);
}... |
b11959d1-c2f5-422c-8cb3-91d92dbc2b44 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
PayloadNearQuery other = (PayloadNearQuery) obj;
if (fieldName == null) {
if (other.fieldName != null)
r... |
a2eb3a62-5b75-4b4f-8a11-b27fa0b6c06a | 2 | public static Color getShapeColor(String seme){
if(seme.equals("picche") || seme.equals("fiori")){
return Color.black;
}else return Color.red;
} |
5db18199-ca26-4308-bf34-b670f6889adf | 6 | public Object call( Object object, String name, Object[] args )
throws BSFException
{
/*
If object is null use the interpreter's global scope.
*/
if ( object == null )
try {
object = interpreter.get("global");
} catch ( EvalError e ) {
throw new BSFException("bsh internal error: "+e.toString(... |
df6af130-81d4-463f-a966-a29ea00ce590 | 3 | public boolean equals(Object obj) {
if (!(obj instanceof Kim)) {
return false;
}
Kim that = (Kim) obj;
if (this == that) {
return true;
}
if (this.hashcode != that.hashcode) {
return false;
}
return java.util.Arrays.equa... |
b144bf8c-51c7-4694-aed2-1b37b6788d43 | 0 | protected Stage getStage() {
return this.stage;
} |
efd84cc6-bb18-4243-addf-890a327afa0f | 5 | public void activate(Robot paramRobot, int paramInt)
{
if ((this.state != null) && (paramRobot != null) && (this.url_target != null) && (this.frame != null))
{
if (GameApplet.appletContext != null)
{
GameApplet.appletContext.showDocument(this.url_target, this.frame);
return;
... |
5718d2fa-7686-4930-bfc7-bd4d8a6f7c0e | 7 | private void jButtonParcourirOutActionPerformed(
final java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
final int nb = 300;
final String mss = "Bouton Parcourir : "
+ "action interdite car ";
String currentDir = "";
currentDir = jTextFieldPathOut.getText();
currentDir = currentD... |
1dd27f57-34f7-4cea-b619-fa7b6d57c3d4 | 8 | public double getCyclePrice(int year_count, int []cycle, double []ratio) { // function to calculate the prices of the possible fuel cycles for the current year
double dummy_price = 999999;
int length = 0;
boolean available=true;
for (int i=0; i<NumberOfTiers; i++) {
if (cycle[i] != -1) {
length++;
i... |
7af134a4-639f-4e5d-bcf8-49d794fecf3d | 2 | protected void buildTopPanel() {
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout(10, 10));
// this does not need to be referenced else where, only for layout
JPanel rightPane = new JPanel();
BoxLayout b = new BoxLayout(rightPane, BoxLayout.Y_AXIS);
rightPane.setLayout(b);
rightPane.add(Box.... |
b0afcde1-b7cf-40d6-b794-7de6cdb8148d | 1 | public Point transformFromViewToAutomaton(Point point) {
try {
return (Point) transform.inverseTransform(point, new Point());
} catch (NoninvertibleTransformException e) {
// Nothing to do.
}
return new Point(point);
} |
ed4273f4-2fbe-4f84-b477-acfbc86ef4ef | 7 | public void HandleInput()
{
if(mLastKeyDown <= 0.1f)
{
return;
}
if(mGame.IsKeyPressed('d'))
Field.MoveActiveBlock(32, 0);
else if(mGame.IsKeyPressed('a'))
Field.MoveActiveBlock(-32, 0);
else if(mGame.IsKeyPressed('s'))
Field.DropActiveBlock();
else if(mGame.IsKeyPressed('1'))
Field.... |
000c70cd-b58c-4339-87f7-429b637b4d66 | 3 | public void addFormat(String formatName) {
if (format == null) format = "";
if (format.indexOf(formatName) >= 0) throw new RuntimeException("Format field '" + formatName + "' already exists!");
// Add to format
format += (format.endsWith(":") ? "" : ":") + formatName;
} |
58d369db-82ab-40ab-a605-2fa214837c24 | 6 | public List<Integer> legalMoves() {
List<Integer> result = new ArrayList<Integer>();
for (int r = 0; r < WIDTH; r++) {
for (int c = 0; c < WIDTH; c++) {
if (squares[r][c] == '.') {
for (int[] offset : OFFSETS) {
int dr = offset[0];
int dc = offset[1];
if (flips(r, c, dr, dc) > 0) {
... |
d3fadac5-8822-49f4-8474-5d1f0a23a29f | 0 | public String getUrl() {
return url;
} |
03a33dd6-ff15-4eb6-bd04-ead8abf73c4a | 6 | public void adjustBeginLineColumn(int newLine, int newCol)
{
int start = tokenBegin;
int len;
if (bufpos >= tokenBegin)
{
len = bufpos - tokenBegin + inBuf + 1;
}
else
{
len = bufsize - tokenBegin + bufpos + 1 + inBuf;
}
int i = 0, j = 0, k = 0;
int nextColDiff = ... |
40acb33e-aa99-42ef-b6a4-a7a613d5de23 | 5 | private static byte[] pdfToPng(final byte[] pdf) throws IOException {
synchronized (GHOST_SCRIPT_ARGS) {
if (ghostScript == null) {
for (final String p : new String[] { "gs", "gswin32c" }) {
final String prog = Programs.which(p);
if (prog != null) {
ghostScript = prog;
... |
e8513edd-ed4e-4de7-8d7d-6b111c25053d | 1 | public void updateParentType(Type otherType) {
setType(otherType);
if (parent != null)
parent.updateType();
} |
b6a41cbd-88c5-40ba-99e4-4e0a47cfd2f9 | 6 | public boolean matches(CharSequence tagname,
Map<CharSequence, CharSequence> attr, int index) {
// MATCH TAGNAME
if (!"*".equals(this.tagname) && !tagname.equals(this.tagname))
return false;
// MATCH ATTRIBUTES
if (this.attributes.size() != 0) {
if (!matchAttributes(attr))
return false;
}
// ... |
abd9580b-c389-49a3-ab86-b933c8003c3f | 8 | public void renderMap(Cell[][] map){
mapPanel.removeAll();
int count = 0;
for(int i = 0; i < 4; i++){
for(int j = 0; j < 4; j++){
JPanel internalGridPanel = new JPanel(new GridLayout(2,2,1,1));
Cell currentCell = map[i][j];
if(current... |
3a8625ac-93a2-4a62-acd1-2293feb686ce | 7 | public static byte base64ToValue(char value)
{
if ('a' <= value && value <= 'z')
return (byte) (value-'a');
if ('A' <= value && value <= 'Z')
return (byte) (value-'A'+26);
if ('0' <= value && value <= '9')
return (byte) (value-'0'+52);
if (value == '?')
return 62;
return 63;
} |
0fd93f8b-7038-4f0d-b197-5c0aceb47919 | 4 | byte[] buildBrushSquare(byte[] brush, CPBrushInfo brushInfo) {
int intSize = (int) (brushInfo.curSize + .99f);
float center = intSize / 2.f;
float size = brushInfo.curSize * (float) Math.sin(Math.PI / 4);
float sizeX = (size / 2) / (1f + brushInfo.curSqueeze * MAX_SQUEEZE);
float sizeY = (size / 2);
float... |
0346218e-ca35-4cf9-b576-59bb91619e63 | 0 | @Id
@Column(name = "module_id")
public String getModuleId() {
return moduleId;
} |
860808da-1651-4ccb-9006-afca53694739 | 3 | public Grafo getSensorGraph() {
Grafo sensor = new Grafo();
ArrayList<Nodo> list = estado.mapa.getListaNodos();
for (Nodo n : list) {
if (sensorKnowledge.contains(n)) {
Nodo aux = sensorKnowledge.getNode(n.id);
sensorKnowledge.updateNodo(aux, n);
}
if (checkNode(n, estado.getActual()) == true)
... |
65b7828d-05b4-485c-bc08-dcca62d171ef | 3 | public Complex geometricMean_as_Complex() {
Complex gmean = Complex.zero();
switch (type) {
case 1:
case 12:
case 14:
Complex[] cc = this.getArray_as_Complex();
gmean = Stat.geometricMean(cc);
break;
default:
throw new IllegalArgumentException("This type number, " + type + ", should not be possi... |
1069aa86-669c-4341-9c2d-e24d041e410f | 9 | public int minCut(String s) {
if (s == null || s.length() < 2) {
return 0;
}
char[] arr = s.toCharArray();
int N = arr.length;
// p[i][j] == true if arr[i->j] is a palindrome.
boolean p[][] = new boolean[N][N];
for (int i = 0; i < N; i++) {
... |
d0875a87-765f-4f87-987f-b7bdb3c9bb70 | 0 | public BankSingleExcelReport1(File file) {
super(file);
// 命名以B开头
this.fileType = BaseReport.TYPE_B;
// 命名使用下划线分为4节
this.fileNameSectionsNumber = 4;
this.reportName = "银行单个账户报表";
this.sheetNames = new String[2];
sheetNames[0] = "2-1";
sheetNames[1] = "2-2";
} |
4ee0a79b-648a-43de-9ae5-2d6149edd8c1 | 5 | public void printLineNumbers(Graphics g, int start, int count, int width) {
Object map = Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints"); //$NON-NLS-1$
if (map != null) {
((Graphics2D) g).addRenderingHints((Map<?, ?>) map);
}
final int insetY = metrics.getLeading() + metri... |
01c02eca-a424-4877-a520-5db33b77670d | 7 | private ItemStack loadItem(String path) {
FileConfiguration f = getKitF();
if (f.get(path) == null) {
return new ItemStack(Material.AIR);
}
ItemStack item = new ItemStack(Material.matchMaterial(f.getString(path + ".material").toUpperCase()));
/*
*
* USUAL CRAP */
if (f.get(path + ".amo... |
491a06ba-4809-4999-8deb-8c9469a7551f | 0 | public byte getNumber() {
return header[0];
} |
a4a9e29f-72a5-45e5-bb44-10e1f8b036bb | 2 | public static boolean isEmpty(String chkStr) {
if (chkStr == null) {
return true;
} else {
return "".equals(chkStr.trim()) ? true : false;
}
} |
52978926-a0c3-43fe-9beb-616be5e49eb9 | 6 | public final static URL getMbAllRecordingsUrl(String title)
throws MusicbrainzUrlException {
if(title == null || title.equals(""))
throw new MusicbrainzUrlException("The title is null or empty");
URL url= null;
URI uri= null;
try {
uri= new URI("http","www.musicbrainz.org",
"/ws/2/re... |
ef2f10ff-4dfa-40e9-a1e9-519946cdef2c | 2 | public void valueChanged (TreeSelectionEvent e)
{
TreePath path = tree.getSelectionPath ();
Object selected;
// deselection, node removal, etc
if (path == null) {
host.draw (editor);
return;
}
selected = path.getLastPathComponent ();
if (selected instanceof USBNode)
((USBNode... |
c47e13cb-9f97-4d03-9d45-3ea1076de0c1 | 9 | @Override
public void run(GameState state, Action action, RuleBook rulebook) throws IllegalActionException {
Team movingTeam = state.getMovingTeam();
// Can reroll
if (!state.isAwaitingReroll() ||
state.getCurrentDiceRoll() == null ||
!state.isAbleToReroll(movingTeam))
throw new IllegalActionE... |
4f5b7eab-ed6f-4961-94f7-926d2fed3aa3 | 3 | public static List<Integer> parseNumericStringArray(String[] strings) throws InvalidRpcDataException {
try {
if (strings == null) {
return null;
}
List<Integer> list = new ArrayList<Integer>();
for (String string : strings) {
lis... |
6904bb9e-7494-4486-b280-5dbd9c405926 | 6 | public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] w = br.readLine().split(" ");
String[] v = br.readLine().split(" ");
int max_w = Integer.parseInt(br.readLine());
int len = w.length;
int[][] r = new int[len][max_w+... |
8307203e-0225-4ee1-9066-b2687f264c68 | 1 | public static void count_one(Integer a) {
int count = 0;
for (int i = 0; i < 32; i++) {
count += (a >> i) & 1;
}
System.out.println(count);
} |
3b45e6b3-7902-4cda-9542-fdf350a0bc2d | 5 | public LookupSwitchInsnNode(
final LabelNode dflt,
final int[] keys,
final LabelNode[] labels)
{
super(Opcodes.LOOKUPSWITCH);
this.dflt = dflt;
this.keys = new ArrayList(keys == null ? 0 : keys.length);
this.labels = new ArrayList(labels == null ? 0 : labels.l... |
090d4b5f-d750-463b-9091-324f8af84910 | 9 | public static void main(String[] args)
{
final CmdLineOptions cmdLineOptions = new CmdLineOptions(args);
int levelLength = cmdLineOptions.getLevelLength();
final int[] timeLimits = new int[]{/*levelLength / 10,
levelLength*2 / 10,*/
... |
1bca373b-f887-4e44-9581-16202db5a14c | 5 | public static ZipFileBuilder loadAlreadyExistsZipFile(File par1File)
throws ZipException, IOException {
ZipFile izf = null;
ZipFileBuilder zfm = null;
File tmpFile = new File(par1File.getAbsolutePath() + ".tmp");
Enumeration<? extends ZipEntry> entries;
par1File.renameTo(tmpFile);
try {
izf = ne... |
f1395141-5f47-4972-ba92-bb801ca49bd2 | 2 | protected void setup() {
if(log.isLoggable(Logger.WARNING))
log.log(Logger.WARNING, "Hello World! This is the " + getLocalName() + "!");
world = new World();
// gui = new WumpusGUI(this);
// gui.setSize(680, 575);
// gui.setLocation(320, 160);
// gui.setVisible(true);
TopicManag... |
23287394-8747-49d8-82e7-6634251b085a | 0 | public EndOfConnectionException(String message) {
super(message);
} |
3b60cfaf-11a7-495a-a694-82a82f3ff039 | 1 | @Override
public void remove(int i) {
for(int j = i; j<=this.size;j++){
this.keys[j] = this.keys[j+1];
}
this.size--;
} |
33e6e04b-e347-4c9b-b1c4-34faf1fcacab | 0 | @Before
public void setUp() {
q = new Queue();
} |
93bb48c9-0b7d-4ee4-8821-beef1f35198c | 8 | public Builder set(Field field, String value) {
switch (field) {
case GROUPID: setGroupId(value); return this;
case ARTIFACTID: setArtifactId(value); return this;
case CLASSIFIER: setClassifier(value); return this;
case OPTIONAL: setOptional("t... |
31068256-31c8-4370-bd89-4f937eab36ff | 6 | public void afficheMap(Graphics fenetre, GestionGraphismes g) throws IOException
{
for(int j=0; j<height; j++)
{
for(int i=0; i<width; i++)
{
if (carte[i][j] == '1') //pour chaque caractere '1', on affiche la texture du mur
fenetre.drawImage(g.getImage("mur"), i*tailleMur+ecartX, j*tailleMur+ecartY... |
79a1f273-e9bf-42eb-91ea-6be9a0c564c8 | 4 | public boolean equals(Object obj) {
if (!(obj instanceof RectObject) || !super.equals(obj))
return false;
RectObject that = (RectObject) obj;
return this.topLeft.equals(that.topLeft) &&
this.width == that.width && this.height == that.height;
} |
a37123de-68b2-4e0a-8b15-d649129a6603 | 1 | public void testConstructor_ObjectStringEx2() throws Throwable {
try {
new DateTime("10:20:30.040+14:00");
fail();
} catch (IllegalArgumentException ex) {
// expected
}
} |
aaeb2b5d-122d-4f78-aeb4-dc4ab3468aef | 9 | @Override
public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
Class mc = method.getDeclaringClass();
log.trace("intercept method : " + method);
if (mc.equals(Object.class)) { //调用的是Object的方法
return method.invoke(this, args);
}
//是Feature
if (Inpu... |
c9ff8f44-72d7-4024-9e31-b3d4c4f5ea65 | 8 | public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
int nCase = 1;
while ((line = in.readLine()) != null && line.length() != 0) {
size = Integer.parseInt(line.trim())... |
0704ef3e-bfd8-425e-9353-cf111a11fed7 | 7 | public final void xor_expr() throws RecognitionException {
try {
// Python.g:321:10: ( and_expr ( CIRCUMFLEX and_expr )* )
// Python.g:321:12: and_expr ( CIRCUMFLEX and_expr )*
{
pushFollow(FOLLOW_and_expr_in_xor_expr2632);
and_expr();
state._fsp--;
if (state.failed) return;
// Python.g:321:21... |
0d71250e-6f4f-4b22-a619-f504c6af4e87 | 0 | @BeforeClass
public static void setUpClass() {
} |
077e5644-12eb-4b7f-b2c4-35afe9d6f1cd | 1 | public JPanel getPasswordBtnMenu() {
if (!isInitialized()) {
IllegalStateException e = new IllegalStateException("Call init first!");
throw e;
}
return this.pwdBtn;
} |
dd142e7f-cfee-4734-8cc9-c642ed84a262 | 7 | @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 TimetablePK)) {
return false;
}
TimetablePK other = (TimetablePK) object;
if (this.period != other.period) {
... |
79050628-fa60-4630-a4e9-0ca5f7be48b9 | 6 | public Object result(Object s, Action a) {
Sudoku sudoku = (Sudoku) s;
int grille[][] = sudoku.getGrille();
int newGrille[][] = new int[9][9];
for(int i= 0 ; i < 9 ; i++){
for(int j = 0 ; j < 9 ; j++){
int pp = grille[i][j];
newGrille[i][j] = pp;
}
}
////// System.out.pri... |
f02a1b64-9eb4-4421-9658-f86f25f47403 | 1 | private void addFilterPanel(JScrollPanelledPane stepScroll) {
for (FilterPanel f : filters)
stepScroll.addComp(f);
} |
7b872858-5157-4e1c-a664-ae5e8efe2eaf | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
AdminInfo other = (AdminInfo)obj;
if (this.password == null) {
if (other.password != null)
return false;
} else if (!this.password.equal... |
48b728ed-a37a-4dc3-bd28-c88ffc78cd56 | 4 | public static void testRadixSort() {
Timer timer = new Timer();
Random random = new Random();
int k = 10; // top k elements
int[] array = new int[1000000];
for (int i = 0; i < array.length; i++)
array[i] = random.nextInt(Integer.MAX_VALUE);
timer.start();
RadixSort.sort(array);
timer.stop();
... |
216cdd5e-7200-4dd7-aec5-d024eaac2079 | 2 | @RequestMapping(value = "/customerForm")
public ModelAndView showCustomerForm(HttpServletRequest request)
{
ModelAndView modelAndView = new ModelAndView("customerForm");
String method = request.getParameter("action");
if (method.equals("add"))
{
modelAndView.... |
88b932e3-6191-4424-a942-f20829037e3a | 8 | @Override
public void run()
{
try
{
sourceDataLine.open(audioFormat);
sourceDataLine.start();
//while there are dates to execute and stop == false
int count = 0;
... |
2573325a-cad6-4900-9ea8-33ea2290da0f | 1 | public void setDownSafe(final boolean flag) {
if (StackPRE.DEBUG) {
System.out.println(this + " DS = " + flag);
}
downSafe = flag;
} |
9a24c799-5ea2-4f5f-80e4-c52efc19ee43 | 5 | void countVcfFile(String fileName) {
// Open file
int readNum = 1;
for (VcfEntry read : new VcfFileIterator(fileName)) {
try {
readLengthCount++;
readLengthSum += read.size();
countMarker(fileName, read);
if (verbose) Gpr.showMark(readNum, SHOW_EVERY);
readNum++;
} catch (Exception e) {... |
a8a3a9b7-d845-4b4e-99d0-1addaf9e910c | 6 | protected Grammar getGrammar() {
int rows = getModel().getRowCount();
RegularGrammar grammar = new RegularGrammar();
grammar.setStartVariable("S");
ArrayList productions = new ArrayList();
for (int i = 0; i < rows; i++) {
Production production = getModel().getProduction(i);
if (production == null)
c... |
82b00d8f-80b2-4467-801a-ac6238e1a69c | 3 | public int[][] importdata(String filename) {
File file;
FileReader fr = null;
BufferedReader br = null;
int[][] data =new int[20][20];
int lineNum = 0;
try {
file = new File(filename);
fr = new FileReader(file);
br = new BufferedReader(fr);
while (br.readLine() != null) {
String line;... |
5b6bf281-2cf6-4ae4-a9ca-464135246530 | 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... |
ad2220ce-4e2b-4fd6-ab09-eded4275dee2 | 3 | public static Reminder getReminder(String id) {
Reminder retVal = null;
try {
XStream xstream = new XStream(new DomDriver());
File remFile = new File((String) Server.prop.get("reminderFilePath"));
Reminder[] allReminders = (Reminder[]) xstream.fromXML(remFile);
for (Reminder reminder : allReminders)... |
498a6b45-96c9-47be-a4a1-8384f083535a | 6 | public String longestCommonPrefix(String[] strs) {
int i = 0;
if (strs.length == 0 ) return "";
if (strs.length == 1 ) return strs[0];
StringBuffer sb = new StringBuffer("");
while (i < strs[0].length())
{
char c = strs[0].charAt(i);
int j;
... |
f5669c4c-dcda-4dad-8756-7ed0611cf30e | 7 | private boolean r_particle_etc() {
int among_var;
int v_1;
int v_2;
// (, line 54
// setlimit, line 55
v_1 = limit - cursor;
// tomark, line 55
if (cursor < I_p1)
{... |
317b6e65-7fe1-451f-af83-f1febba90cb7 | 0 | public boolean hasGeneratorFor(String tableName, String columnName) {
return (this.getGeneratorFor(tableName, columnName) != null);
} |
83759ce3-9613-47ed-8059-f49030d3078d | 4 | @Override
public void run () {
logger.entering(loggerName, "run");
while (true) {
try {
NewsMLQueueElement qe = (NewsMLQueueElement) dequeue(inq);
Document doc = qe.getDocument();
if (isReady(doc)) {
pr... |
0eafdd54-6daa-477b-adae-77e151ec26e6 | 1 | public List<Double> getMedianList() {
List<Double> result= new ArrayList<Double>();
double[] values= this.getMedianArray();
for (int i= 0; i< values.length; ++i) {
result.add(Double.valueOf(values[i]));
}
return result;
} |
c745bfc1-dd76-4566-8957-ccf85359de24 | 4 | private void selectOption(int option) {
if (allowClick) {
game.jukeBox.play(game.jukeBox.tracks.buttonClick);
if (option == 0) {
game.log.gsm("[MENU] [PAUSED] Going to main menu");
gsm.setPaused(false);
gsm.unloadState(GameStateManager.PLAY);
game.level.removeAll();
doInit = true;
ticks ... |
f88af5f1-ff7b-4590-8ac4-2a045b27607a | 6 | public final static URL getMbArtistUrl(String artist)
throws MusicbrainzUrlException {
if(artist == null || artist.equals(""))
throw new MusicbrainzUrlException("The artist is null or empty");
URL url= null;
URI uri= null;
try {
//In case of more than one matches, only the first one (with ... |
8dccc09f-f272-43fe-b778-e5cd6488a553 | 6 | static final int method1239(Class73 class73, Class73 class73_1) {
int j = 0;
if (class73.method791(Class39_Sub4.anInt2992)) {
j++;
}
if (class73.method791(Class86.anInt1484)) {
j++;
}
if (class73.method791(Class142_Sub8_Sub7.anInt4024)) {
... |
04048d50-c978-47fd-94a0-4f2f43da8cbc | 0 | public String getType()
{
return this.type;
} |
8a701071-ecf8-4db6-adce-e232b7015e0b | 3 | private boolean canAddNewShape() {
for (int row = START_ROW; row <= END_ROW; row++) {
for (int col = START_COL; col <= END_COL; col++) {
if (getCell(row, col).isPopulated()) return false;
}
}
return true;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.