Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringlengths
31
34
content
stringlengths
74
328k
api-misuse-repair-single_data_1
public void loadUserProvidedLogConfiguration() { ConfigRegistry configRegistry = ConfigRegistry.getInstance(); Iterator<String> keys = configRegistry.keySetIterator(); keys.forEachRemaining(key -> { if (key.endsWith(LOG_LEVEL)) { loggerLevels.put(key.substring(0, key.length() - LOG_LEVEL.length()), BLogLevel.toBLogLeve...
api-misuse-repair-single_data_2
@Override public void sendMsgToServer(String msg) { try { if (msg != null && msg.length() > 0) { sendMsg(msg); } } catch (Exception e) { Log.e(TAG, "sendMsgToServer exception: " + e.getMessage()); } } @Override public void sendMsgToServer(String msg) { try { if (msg != null && msg.length() > 0) { sendMsg(msg); } } ca...
api-misuse-repair-single_data_3
public void actionPerformed(ActionEvent e) { if (e.getSource() == clearButton) { drawer.clear(); repaint(); } else if (e.getSource() == removePoints) { isDrawing = false; isEditing = false; } else if (e.getSource() == addPoints) { isDrawing = true; isEditing = false; } else if (e.getSource() == editPoints) { isDrawing ...
api-misuse-repair-single_data_4
@Override public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition mop) { if (mop == null) return itemstack; Block block = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); int meta = world.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ); TileEntity tile = wo...
api-misuse-repair-single_data_5
public IScope scope_NewObject_eClass(Feature feature, EReference eReference) { if (feature.getEFeature() instanceof EReference) { final IScope parent = delegateGetScope(feature, eReference); return ePackageScopeProvider.createEClassScope(feature.eResource(), (EClass) feature.getEFeature().getEType(), parent); } else re...
api-misuse-repair-single_data_6
@Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { allarme.setEnabled(false); runnableSwitch = new RunnableSwitch(!allarme.isEnabled()); handler.postDelayed(runnableSwitch, TIMEOUT_COMMAND); Bundle data = new Bundle(); data.putCharSequence(MqttService.TOPIC, NODE + "/Allarme/c"); dat...
api-misuse-repair-single_data_7
public int lengthOfLastWord(String s) { if (s == null || s == "") return 0; String[] parts = s.split(" +"); if (parts.length == 0) return 0; return parts[parts.length - 1].length(); } public int lengthOfLastWord(String s) { if (s == null || s.equals("")) return 0; String[] parts = s.split(" +"); if (parts.length == 0...
api-misuse-repair-single_data_8
public String getType() { if (TextUtils.isBlank(type) && !TextUtils.isBlank(number)) { if (TextUtils.hasAnyPrefix(number, PREFIXES_AMERICAN_EXPRESS)) { return AMERICAN_EXPRESS; } else if (TextUtils.hasAnyPrefix(number, PREFIXES_DISCOVER)) { return DISCOVER; } else if (TextUtils.hasAnyPrefix(number, PREFIXES_JCB)) { ret...
api-misuse-repair-single_data_9
@Override public final void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding(StandardCharsets.UTF_8.name()); response.setCharacterEncoding(StandardCharsets.UTF_8.name()); response.setLocale(Locale.getDefault()); if (this.driver == null) ...
api-misuse-repair-single_data_10
private ArrayList<PageObjectAdvanced> parseTextForPageObjects(String text, int pos, int depth) { ArrayList<PageObjectAdvanced> output = new ArrayList<PageObjectAdvanced>(); int lastOpenIndex; int openIndex = -1; int innerCloseIndex = -1; int objectID = -1; String[] openStrings = new String[] { "{{", "[[", "[" }; String...
api-misuse-repair-single_data_11
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { String commandName = command.getName(); if (COMMAND_WAYPOINT.compareToIgnoreCase(commandName) == 0) { Player player = null; if (sender instanceof Player) { player = (Player) sender; } else { sender.sendMessage(ChatColor.RED +...
api-misuse-repair-single_data_12
@Override public V get(K key) { int indexToGet = hash(key); HashEntry<K, V> cursor = dataArray[indexToGet]; while (cursor != null && cursor.getKey() != key) { cursor = cursor.getNext(); } if (cursor == null) { return null; } return cursor.getValue(); } @Override public V get(K key) { int indexToGet = hash(key); HashE...
api-misuse-repair-single_data_13
public static char[] chars(char[] chars) { for (int i = 0, j = chars.length - 1; i < chars.length / 2; I++, j--) { char c = chars[i]; chars[i] = chars[j]; chars[j] = c; } return chars; } public static char[] chars(char[] chars) { for (int i = 0, j = chars.length - 1; i < chars.length / 2; i++, j--) { char c = chars[i...
api-misuse-repair-single_data_14
public static void main(String[] args) throws UnknownHostException { SpringApplication app = new SpringApplication(Application.class); SimpleCommandLinePropertySource source = new SimpleCommandLinePropertySource(args); addDefaultProfile(app, source); Environment env = app.run(args).getEnvironment(); log.info("Access UR...
api-misuse-repair-single_data_15
@Override public IDataObject rawToObject(String data) throws Exception { logger.log("Converting xml to object..."); data = stripString(data); Document dom = loadXMLFromString(data); IDataStructure top = processLayer(dom.getChildNodes(), "XMLTree"); return top; } @Override public IDataObject rawToObject(String data) t...
api-misuse-repair-single_data_16
private void processHeartbeat(HeartbeatReport report, Heartbeat heartbeat, MessageTree tree) { String ip = tree.getIpAddress(); Machine machine = report.findOrCreateMachine(ip); Period period = buildHeartBeatInfo(machine, heartbeat, tree.getMessage().getTimestamp()); if (period != null) { machine.getPeriods().add(perio...
api-misuse-repair-single_data_17
@Override public void prepareWriteEmpty(IIOMetadata streamMetadata, ImageTypeSpecifier imageType, int width, int height, IIOMetadata imageMetadata, List<? extends BufferedImage> thumbnails, ImageWriteParam param) throws IOException { ArgumentChecks.ensureNonNull("imageType", imageType); if (param == null) { param = get...
api-misuse-repair-single_data_18
public void setName() { this.name = vehicle.getVehicleType() + getVehicleNumber(); vehicleNumber++; } public void setName() { this.name = getVehicleType() + getVehicleNumber(); vehicleNumber++; }
api-misuse-repair-single_data_19
public void parseCommand(String msgJson) throws IllegalArgumentException, NoSuchFieldException, IllegalAccessException, IOException { CommandMsg msg = ((new Gson()).fromJson(msgJson, CommandMsg.class)); String var = fromYangToJava(msg.var); switch(msg.act) { case GET: log.info("Arrived from ConnectionModule the command...
api-misuse-repair-single_data_20
public boolean getCompletionStatus() { return (boolean) this.getCompletionStatus(); } public boolean getCompletionStatus() { return (boolean) this.getItem(user_comp); }
api-misuse-repair-single_data_21
public void validate() { super.validate(); if (Strings.isNullOrEmpty(username) ^ Strings.isNullOrEmpty(password)) { throw new IllegalArgumentException("You must either set both username and password or " + "neither username nor password."); } try { InternetAddress[] addresses = InternetAddress.parse(sender); if (addres...
api-misuse-repair-single_data_22
private static void sendMail(Context context, String emailText) { Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE); if (!includeFiles || savedErrorFilePaths == null || savedErrorFilePaths.length == 1) { emailIntent = new Intent(android.content.Intent.ACTION_SEND); } emailIntent.putExtra(andr...
api-misuse-repair-single_data_23
@Override protected void initWidget(View parentView) { super.initWidget(parentView); mRv.setLayoutManager(mManager); mRv.setAdapter(mAdapter); mAdapter.setViewCallBack(new RecommendedViewAdapter.ViewCallBack() { @Override public void onClickListener(DataBean dataBean) { Intent intent = new Intent(); intent.putExtra("co...
api-misuse-repair-single_data_24
public static CuratorFramework getClient(String hostPort, String nameSpace) { HttpSession session = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest().getSession(); String key = PRE + hostPort; CuratorFramework client = null; Object obj = session.getAttribute(key); if (obj == null) { ...
api-misuse-repair-single_data_25
public Article getThreads(String boardName, int id, String au, int count, int page) throws ClientProtocolException, JSONException, NForumException, IOException { String url = host + "threads/" + boardName + "/" + id + returnFormat + appkey + "&count=" + count + "&page=" + page; if (null != au && !au.isEmpty()) { url = ...
api-misuse-repair-single_data_26
public byte[] bytes() throws IOException { return response.body().bytes(); } public byte[] bytes() throws IOException { return string().getBytes(); }
api-misuse-repair-single_data_27
public static int getSingleMealList(int k, int month, int day, int year, boolean collegeNight, boolean otherCollegeforCNight, boolean healthyMonday, boolean farmFriday) { Document breakfastDoc, lunchDoc, dinnerDoc; Elements breakfastNutIds = null, breakfastFoodNames = null, lunchNutIds = null, lunchFoodNames = null, di...
api-misuse-repair-single_data_28
private boolean tryToLaunchSlave(LinkedList<String> remainingSlaves, String jenkinsUrl, String privateIpAddress) { try { if (remainingSlaves.size() == 0) { logger.println("No slaves remaining to associate!"); return false; } logger.println("Trying to connect to " + privateIpAddress); Connection sshConnection = new Conn...
api-misuse-repair-single_data_29
@Transactional @Override public UserDTO create(final UserDTO userDTO) throws UserAlreadyExists { log.info("Registering user: {}", userDTO); User user = DTOConverter.convert(userDTO, User.class); if (userRepository.findByUsername(userDTO.getUsername()) != null) { throw new UserAlreadyExists(); } user.setEmail(user.getUs...
api-misuse-repair-single_data_30
@Override public JobHolder nextJobAndIncRunCount(boolean hasNetwork, Collection<String> excludeGroups) { String selectQuery = nextJobsQueryCache.get(hasNetwork, excludeGroups); if (selectQuery == null) { String where = createReadyJobWhereSql(hasNetwork, excludeGroups, false); selectQuery = sqlHelper.createSelect(where,...
api-misuse-repair-single_data_31
public static void main(String[] args) { System.out.println("Hello World!"); Array2D array2D = QuizReader.read("sample.json"); PuzzleState puzzleStateJanusz = new PuzzleState.PuzzleStateBuilder(array2D).build(); Graph grafJanusz = new Graph.GraphBuilder(puzzleStateJanusz).depth(25).build(); System.out.println("porobion...
api-misuse-repair-single_data_32
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.content_create_account); Intent intent = getIntent(); String message = intent.getStringExtra(MainActivity.create_Success); TextView textView = (TextView) findViewById(R.id.createMessage); textView....
api-misuse-repair-single_data_33
public Player apply(Transform transform) { int id = this.id; String name = this.name; int lives = this.lives; int hitPoints = this.hitPoints; int maxHitPoints = this.maxHitPoints; int money = this.money; int mana = this.mana; int maxMana = this.maxMana; List<Item> items = this.items; String levelId = this.levelId; Stri...
api-misuse-repair-single_data_34
private final float[] probabilisticDiffusion2D(float[] proba, byte[] dir, int ngbsize, float maxdiff, float angle, float factor, int iter) { for (int x = 0; x < nx; x++) for (int y = 0; y < ny; y++) for (int z = 0; z < nz; z++) { int xyz = x + nx * y + nx * ny * z; if (x < 1 || y < 1 || z < 1 || x >= nx - 1 || y >= ny ...
api-misuse-repair-single_data_35
@Override public void registerRecv(IConnectionCallback cb) { cb = cb; } @Override public void registerRecv(IConnectionCallback cb) { this.cb = cb; }
api-misuse-repair-single_data_36
boolean notEqualsExprSignsReduction(NotEqualsExpr notEqualsExpr) throws DivideByZeroException { ArithExpr arithExpr1 = notEqualsExpr.getExpression1(); ArithExpr arithExpr2 = notEqualsExpr.getExpression2(); Signs signs1, signs2; String varName1 = null, varName2 = null; Signs trueSigns1, trueSigns2; if (arithExpr1 instan...
api-misuse-repair-single_data_37
@NotNull private static ResourceTable buildResourceTable(String packageName, ResourcePath appResourcePath, List<ResourcePath> allResourcePaths) { PackageResourceIndex resourceIndex = new PackageResourceIndex(packageName); ResourceTable resourceTable = new ResourceTable(resourceIndex); ResourceRemapper resourceRemapper ...
api-misuse-repair-single_data_38
@Override public JsonElement serialize(final GameType pGameType, final Type typeOfSrc, final JsonSerializationContext context) { return new JsonPrimitive(pGameType.getGameName()); } @Override public JsonElement serialize(final GameType pGameType, final Type typeOfSrc, final JsonSerializationContext context) { return ...
api-misuse-repair-single_data_39
public void update(User user) { if (user.getPassword() != "" || user.getPassword() != null) { user.setPassword(passwordEncoder.encode(user.getPassword())); } else { user.setPassword(getPasswordById(user.getId())); } session().update(user); } public void update(User user) { if (user.getPassword().length() > 3) { user....
api-misuse-repair-single_data_40
public void start() { sshServer = SshServer.setUpDefaultServer(); sshServer.setPort(2222); sshServer.setHost("0.0.0.0"); final String basePath = SystemInstance.get().getBase().getDirectory().getAbsolutePath(); if (SecurityUtils.isBouncyCastleRegistered()) { sshServer.setKeyPairProvider(new PEMGeneratorHostKeyProvider(n...
api-misuse-repair-single_data_41
public void executeScript(String scriptPath) { BufferedReader input = null; String query; int numberOps = 0; try { input = new BufferedReader(new InputStreamReader(new FileInputStream(new File(scriptPath)), "UTF-8")); while ((query = input.readLine()) != null) { query = query.trim(); if (query.length() > 0 && !query.st...
api-misuse-repair-single_data_42
@Override public List<AbstractParty> getParticipants() { return ImmutableList.of(lender, borrower); } @Override public List<AbstractParty> getParticipants() { return Arrays.asList(lender, borrower); }
api-misuse-repair-single_data_43
@POST @Path("upload/{name}/{type}") @Consumes("text/plain") public Response loadToponyms(String toponymsAsCsv, @PathParam("name") String datasetName, @PathParam("type") String type) { CsvConfiguration csvConfiguration = new CsvConfiguration(); switch(type.toLowerCase()) { default: case "csv": csvConfiguration.setFieldD...
api-misuse-repair-single_data_44
@Override public void loadWorld(WorldClient par1WorldClient, String par2Str) { super.loadWorld(par1WorldClient, par2Str); theServer = null; ApiBase.localPlayer = this.thePlayer; } @Override public void loadWorld(WorldClient par1WorldClient, String par2Str) { super.loadWorld(par1WorldClient, par2Str); theServer = (Int...
api-misuse-repair-single_data_45
private static void setupDefaultRewards(File rewardsDir) { File defaultConfig = new File(rewardsDir, "default_rewards.json"); try { FileUtils.forceMkdirParent(defaultConfig); FileUtils.copyToFile(MinecraftServer.class.getClassLoader().getResourceAsStream("assets/" + ForgeVotifier.MODID + "/reward/default_rewards.json")...
api-misuse-repair-single_data_46
public String deleteSharingDoctor(SharingDoctorModel doctor) { HttpResponseClient client = new HttpResponseClient(); List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("sharing_doctor_id", String.valueOf(doctor.getSharingDoctorId()))); params.add(new BasicNameValuePair("docto...
api-misuse-repair-single_data_47
public BlockVector toBlockVector() { return new BlockVector(this); } public BlockVector toBlockVector() { return toBlockPoint(); }
api-misuse-repair-single_data_48
public String nextXmlString(int length) { byte[] data = new byte[length]; for (int i = 0; i < length; ++i) { data[i] = (byte) nextInt(FIRST_XML_PRINTABLE_CHAR, LAST_XML_PRINTABLE_CHAR); } return new String(data); } public String nextXmlString(int length) { byte[] data = new byte[length]; for (int i = 0; i < length; +...
api-misuse-repair-single_data_49
@Override public void setG(float g) { this.rgba |= ((int) (g * 255f)) << 8; } @Override public void setG(float g) { rgba = (rgba & 0xFFFF00FF) | ((int) (g * 255f)) << 8; }
api-misuse-repair-single_data_50
@FXML protected void handleBtnLogin(ActionEvent event) throws IOException { System.out.println("Login btn pressed"); Parent parent = FXMLLoader.load(getClass().getResource("/fxml/dashboard.fxml")); Scene scene = new Scene(parent); Stage appStage = (Stage) ((Node) event.getSource()).getScene().getWindow(); appStage.setS...
api-misuse-repair-single_data_51
public ArrayList<InventoryItem> getPlayerInventory() { return playerInventory; } public ArrayList<InventoryItem> getPlayerInventory() { return new ArrayList<InventoryItem>(this.playerInventory); }
api-misuse-repair-single_data_52
@Override public String rewriteUrl(final String url, final String sessionId) { if ((url == null) || (sessionId == null)) return (url); String path = url; String query = ""; String anchor = ""; String fragment = ""; int question = url.indexOf('?'); if (question >= 0) { path = url.substring(0, question); query = url.subs...
api-misuse-repair-single_data_53
public static void combatChecks(EntityDamageByEntityEvent event, mcMMO plugin) { if (event.getDamage() == 0 || event.getEntity().isDead()) { return; } Entity damager = event.getDamager(); LivingEntity target = (LivingEntity) event.getEntity(); EntityType damagerType = damager.getType(); EntityType targetType = target.g...
api-misuse-repair-single_data_54
public boolean updateItem(long rowId, String title, String description) { ContentValues argumentValues = new ContentValues(); argumentValues.put(KEY_TITLE, title); argumentValues.put(KEY_TITLE, description); return sqlLiteDb.update(DATABASE_TABLE, argumentValues, KEY_ROWID + "=" + rowId, null) > 0; } public boolean u...
api-misuse-repair-single_data_55
public ClassContext<CodeElement> convert(ClassContext<String> classContext) { StateManager stateManager = stateManagerFactory.createStateManager(); CodeElement[] elements = new CodeElement[classContext.numberOfElements()]; int index = 0; while (classContext.hasNext()) { final String word = classContext.next(); elements...
api-misuse-repair-single_data_56
private static NoiseLayer[] generateNoiseLayers(int octaves, double baseScale, double scaleMultiplier, double baseFrequency, double frequencyMultiplier, long... seeds) { if (octaves <= 0) throw new IllegalArgumentException("The number of octaves has to be positive"); if (seeds.length != octaves) throw new IllegalArgume...
api-misuse-repair-single_data_57
private String loadXmlFromNetwork(String urlString) throws XmlPullParserException, IOException { InputStream stream = null; StackOverflowXmlParser stackOverflowXmlParser = new StackOverflowXmlParser(); List<Entry> entries = null; String title = null; String url = null; String summary = null; Calendar rightNow = Calenda...
api-misuse-repair-single_data_58
@RequestMapping(value = "/registration", method = RequestMethod.POST) @PreAuthorize("hasRole('createUsers') and hasRole('logon')") public String createUserSubmit(@Valid User user, BindingResult bindingResult, ModelMap model) { if (bindingResult.hasErrors()) { return "mainPortal/registration"; } else { ArrayList<Permiss...
api-misuse-repair-single_data_59
private void parseExportFiles(HashMap<File, String> files) throws IOException { Iterator<String> i = exports.keySet().iterator(); while (i.hasNext()) { String key = i.next(); String[] rule = key.split(ruleTypeSplit); if (rule.length != 2) { throw new IOException("Export file failed: " + key); } String packName = rule[0...
api-misuse-repair-single_data_60
public void setWeight(double weight) throws InvalidInputException { if (weight <= 0 || weight > 999) { throw new InvalidInputException("Error: Weight must be > 0 and <= 999."); } this.weight = weight; } public void setWeight(double weight) throws InvalidInputException { if (weight <= 0 || weight > 999) { throw new In...
api-misuse-repair-single_data_61
@Override protected DataTableSpec[] configure(final DataTableSpec[] inSpecs) throws InvalidSettingsException { if (shpFileLoc.getStringValue() == null) { throw new InvalidSettingsException("No shape file name specified"); } if (projection.getStringValue() == null) { throw new InvalidSettingsException("You must have a s...
api-misuse-repair-single_data_62
@Override public void onMousePressed(MouseEvent event) { if (event.getClickCount() > 1) { return; } if (event.getButton() != MouseEvent.BUTTON1) { return; } GraphTool selectedTool = this.selectionHandler.getSelectedTool(); if (IEdge.class.isInstance(selectedTool.getNodeOrEdge())) { return; } double zoom = editorPart.ge...
api-misuse-repair-single_data_63
@Override public void onResetDisscroll() { if (mDisscrollAlpha) { setAlpha(0); } if (mDisscrollScaleX) { setScaleX(1); } if (mDisscrollScaleY) { setScaleY(1); } if (isTranslationFrom(TRANSLATION_FROM_BOTTOM)) { setTranslationY(mHeight); } if (isTranslationFrom(TRANSLATION_FROM_TOP)) { setTranslationY(-mHeight); } if (i...
api-misuse-repair-single_data_64
public synchronized void removeConnection(L2GameClient client) { if (ConfigData.DUALBOX_PROTECTION_ENABLED) { try { IpPack pack = new IpPack(client.getConnection().getInetAddress().getHostAddress(), client.getTrace()); Integer count = _address.get(pack) != null ? _address.get(pack) : 0; if (count > 0) { _address.put(pa...
api-misuse-repair-single_data_65
@Override public void cacheImportant(TileEntity tile, int side) { if (attachments[side] instanceof IFilterAttachment) { filterCache[side] = ((IFilterAttachment) attachments[side]).getFluidFilter(); } cache[side] = tile.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, EnumFacing.VALUES[side]); } @Overrid...
api-misuse-repair-single_data_66
public void runActions() { UUID uid; for (ActionBase act : actions) { if (act == null) continue; uid = ActionExecutor.run(act); if (uid == null) continue; uuids.add(uid); } MoverPool moverPool = MoverPool.getInstance(); while (uuids.size() != 0) { for (Iterator<UUID> iter = uuids.iterator(); iter.hasNext(); ) { UUID id...
api-misuse-repair-single_data_67
public int executeOperations(ArrayList<String> queryResult, ParseOperation[] operations, WhoisEntry entry, boolean errorMode) { String queryLine; int operationCount = 0; boolean multilineCatch = false; for (int i = 0; i < queryResult.size(); i++) { if (operationCount == operations.length) break; queryLine = queryResult...
api-misuse-repair-single_data_68
@Override public int compare(Student o1, Student o2) { return o1.getStudentName().compareTo(o2.getStudentName()); } @Override public int compare(Student o1, Student o2) { return o1.getmStudentName().compareTo(o2.getmStudentName()); }
api-misuse-repair-single_data_69
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); dba = new DBAccessor(this); sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); list = (ListView) findViewById(R.id.conversation_list); msgList = ContactRetriever.getSMS(this); MessageAdap...
api-misuse-repair-single_data_70
private void setTargetLocation() { String target_name = getIntent().getStringExtra("target_name"); Double target_lng = getIntent().getDoubleExtra("target_longitude", 0); Double target_lat = getIntent().getDoubleExtra("target_latitude", 0); target = new Point(target_name, target_lng, target_lat); } private void setTar...
api-misuse-repair-single_data_71
public static void testInsert() { Edge[] emptyArray = null; Point testPoint = new Point(1432, "testPoint", 23, 56, emptyArray, 0); insertPoint(testPoint); } public static void testInsert() { Edge[] emptyArray = null; Point testPoint = new Point(1432, "testPoint", 23, 56, 0); insertPoint(testPoint); }
api-misuse-repair-single_data_72
@Override public User getUser(Renderer renderer, HttpServletRequest request) throws IOException { String remoteUser = request.getRemoteUser(); if (remoteUser == null) remoteUser = request.getHeader("X-OSS-REMOTE-USER"); ActiveDirectory activeDirectory = null; if (StringUtils.isEmpty(remoteUser)) throw new AuthException...
api-misuse-repair-single_data_73
private static void extractSubpartsRecursive(Formula f, Set<String> res) { res.add(f.toString()); if (f instanceof AggregateFormula) { AggregateFormula aggFormula = (AggregateFormula) f; extractSubpartsRecursive(aggFormula, res); } else if (f instanceof CallFormula) { CallFormula callFormula = (CallFormula) f; extractS...
api-misuse-repair-single_data_74
private synchronized void initStickers() { if (sStickerManager == null) { sStickerManager = sStickerManager.getInstance(mContext); try { String basePath = "stickers/olo_and_shimi_1"; AssetManager aMan = mActivity.getAssets(); String[] filelist = aMan.list(basePath); String category = "Olo & Shimi"; for (int i = 0; i < ...
api-misuse-repair-single_data_75
private void updateCachedIssue(Issue issue) { TurboIssue newCached = new TurboIssue(issue); int index = getIndexOfIssue(issue.getNumber()); if (index != -1) { issues.set(index, newCached); } else { issues.add(0, newCached); } } private void updateCachedIssue(Issue issue) { TurboIssue newCached = new TurboIssue(issue)...
api-misuse-repair-single_data_76
private void connectDisconnect() { if (socket == null && client == null) { String err = null; try { outputArea.append("Connecting...\n"); socket = new Socket(ipField.getText(), new Integer(portField.getText())); if (socket != null) client = new Client(socket, inputArea, outputArea); else throw new Exception("Could not ...
api-misuse-repair-single_data_77
public String setBISha1(String biSha1) { return BISha1; } public void setBISha1(String biSha1) { BISha1 = biSha1; }
api-misuse-repair-single_data_78
public String modify() throws ClassNotFoundException, SQLException { String userType = (String) session.getAttribute("userType"); if (userType.equals("student")) { Student newStudent = (Student) session.getAttribute("student"); newStudent.setStudent_id(Integer.parseInt(student_id)); newStudent.setStudent_num(student_nu...
api-misuse-repair-single_data_79
@Override public void loadWarps() { synchronized (warpLock) { warps = new ArrayList<Warp>(); String location = etc.getInstance().getWarpLocation(); if (new File(location).exists()) { try { Scanner scanner = new Scanner(new File(location)); while (scanner.hasNextLine()) { String line = scanner.nextLine(); if (line.start...
api-misuse-repair-single_data_80
@Override public void handleResponse(ChannelMessage message) { LOG.fine("Received SER : " + message.getMessage() + " from: " + message.getAddress() + " port: " + message.getPort()); StringTokenizer stringToken = new StringTokenizer(message.getMessage(), " "); String length = stringToken.nextToken(); String keyword = st...
api-misuse-repair-single_data_81
public String getPersianSep(sepStat decimalSep, sepStat groupSep) { DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols(Locale.US); switch(decimalSep) { case COMMA: otherSymbols.setDecimalSeparator(','); break; case DOT: otherSymbols.setDecimalSeparator('.'); break; case SLASH: otherSymbols.setDecimalSeparator...
api-misuse-repair-single_data_82
public static void injectJavascriptFile(Context context, WebView view, int rawResId) { InputStream input; try { input = context.getResources().openRawResource(rawResId); byte[] buffer = new byte[input.available()]; input.read(buffer); input.close(); String encoded = Base64.encodeToString(buffer, Base64.NO_WRAP); view.l...
api-misuse-repair-single_data_83
@Override public JSONObject createParserUIInitializationData(ImportingJob job, List<JSONObject> fileRecords, String format) { JSONObject options = super.createParserUIInitializationData(job, fileRecords, format); JSONArray columnWidths = new JSONArray(); if (fileRecords.size() > 0) { JSONObject firstFileRecord = fileRe...
api-misuse-repair-single_data_84
@Override public void onCreateResources() { BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/"); this.mBitmapTextureAtlas = new BitmapTextureAtlas(this.getTextureManager(), 32, 32, TextureOptions.BILINEAR); this.mBitmapTextureAtlas2 = new BitmapTextureAtlas(this.getTextureManager(), 1024, 1024, TextureOptio...
api-misuse-repair-single_data_85
@Override public boolean understands() { return command.toLowerCase().indexOf("select ") == 0 || command.toLowerCase().indexOf("insert ") == 0 || command.toLowerCase().indexOf("drop ") == 0 || command.toLowerCase().matches(UPDATE_REGEX) || command.toLowerCase().matches(DELETE_REGEX) || command.toLowerCase().matches(CRE...
api-misuse-repair-single_data_86
private static void checkPhase() { Preconditions.checkState(Loader.instance().getLoaderState().ordinal() > LoaderState.INITIALIZATION.ordinal(), "Recipes should be registered during Init."); } private static void checkPhase() { Preconditions.checkState(Loader.instance().getLoaderState().ordinal() > LoaderState.INITIA...
api-misuse-repair-single_data_87
public String markAsFailed(String url) { String baseUrl = balancerStrategy.markAsOffline(url); failedEndpoints.add(baseUrl); logger.debug("Url '{}' is marked as failed and will be considered offline by {}", url, balancerStrategy); return baseUrl; } public String markAsFailed(String url) { String baseUrl = balancerStr...
api-misuse-repair-single_data_88
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { g.setColor(new Color(170, 180, 179)); g.fillRect(x, y, w, h); if (isSelected) { g.setColor(new Color(216, 37, 37)); g.fillRect(x, y, w, h); } } protected void paintTabBackground(Graphics g, ...
api-misuse-repair-single_data_89
public AdapterConfig getAdapterConfig(String type) { AdapterConfig matchedAdapterConfig = null; for (AdapterConfig adapterConfig : adapterConfigs) { if (adapterConfig.getType().equals(type)) { matchedAdapterConfig = adapterConfig; break; } } return matchedAdapterConfig; } public AdapterConfig getAdapterConfig(String ...
api-misuse-repair-single_data_90
@Override public float getTemperatureBaseModifier() { return this.getTemperatureBaseModifier(); } @Override public float getTemperatureBaseModifier() { return this.temperatureBaseModifier; }
api-misuse-repair-single_data_91
@Override public void run() { double leftDrivePower = -gamepad1.left_stick_y; double rightDrivePower = -gamepad1.left_stick_y; double leftStrafePower = gamepad1.left_stick_x; double rightStrafePower = gamepad1.right_stick_x; setDrive(leftDrivePower, rightDrivePower, rightStrafePower, leftStrafePower); } @Override pub...
api-misuse-repair-single_data_92
private boolean hasTabsWithLabels() { for (int i = 0; i < getItemsCount(); i++) { String title = getItem(0).getTitle(getContext()); if (!TextUtils.isEmpty(title)) { return true; } } return false; } private boolean hasTabsWithLabels() { for (int i = 0; i < getItemsCount(); i++) { String title = getItem(i).getTitle(get...
api-misuse-repair-single_data_93
@Override public boolean getPass() { try { return status = (computeAverage() > 60); } catch (UndergraduateException e) { return false; } } @Override public boolean getPass() { try { return status = (computeAverage() > 60); } catch (UndergraduateException e) { return status = false; } }
api-misuse-repair-single_data_94
public String toString() { return "Start time: " + startTime + " End time: " + endTime + " Duration: " + duration + " Bus ID: " + busID + " Driver ID: " + driverID; } public String toString() { return "Start time: " + startTime() + " End time: " + endTime() + " Duration: " + duration() + " Bus ID: " + busID + " Drive...
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
10