auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected static ChannelHandler wrapChannelHandler(URL url, ChannelHandler handler) { url = ExecutorUtil.setThreadName(url, CLIENT_THREAD_POOL_NAME); String key = Constants.DEFAULT_KEY + Constants.HIDE_KEY_PREFIX + Constants.THREADPOOL_KEY; String threadpool = url.getParameter(key); if (StringUtils.isNotEmpty(threadpool)) { url = url.removeParameter(key); } url = url.addParameterIfAbsent(Constants.THREADPOOL_KEY, StringUtils.isNotEmpty(threadpool) ? threadpool : Constants.DEFAULT_CLIENT_THREADPOOL); return ChannelHandlers.wrap(handler, url); }

Target:
protected static ChannelHandler wrapChannelHandler(URL url, ChannelHandler handler) { url = ExecutorUtil.setThreadName(url, CLIENT_THREAD_POOL_NAME); url = url.addParameterIfAbsent(Constants.THREADPOOL_KEY, Constants.DEFAULT_CLIENT_THREADPOOL); return ChannelHandlers.wrap(handler, url); }
Source:
public void onReceive(Context context, Intent intent) { NotificationHandler.sendNotification(context, context.getString(R.string.local_notifications_text)); TestData.getInstance(context, null); TestData.doNetworkMeasurements(context, "web_connectivity", null); TestData.doNetworkMeasurements(context, "http_invalid_request_line", null); TestData.doNetworkMeasurements(context, "ndt_test", null); }

Target:
public void onReceive(Context context, Intent intent) { NotificationHandler.sendNotification(context, context.getString(R.string.local_notifications_text)); TestData.getInstance(context, null); TestData.doNetworkMeasurements(context, OONITests.WEB_CONNECTIVITY, null); TestData.doNetworkMeasurements(context, OONITests.HTTP_HEADER_FIELD_MANIPULATION, null); TestData.doNetworkMeasurements(context, OONITests.HTTP_INVALID_REQUEST_LINE, null); TestData.doNetworkMeasurements(context, OONITests.NDT, null); TestData.doNetworkMeasurements(context, OONITests.DASH, null); }
Source:
private void checkIsAuthorizedToReadHistoryAndTenants() { CompositePermissionCheck suspensionStatePermission = new PermissionCheckBuilder() .conjunctive() .atomicCheckForResourceId(PROCESS_DEFINITION, ANY, READ_HISTORY) .atomicCheckForResourceId(DECISION_DEFINITION, ANY, READ_HISTORY) .atomicCheckForResourceId(TENANT, ANY, READ) .build(); getAuthorizationManager().checkAuthorization(suspensionStatePermission); }

Target:
private void checkIsAuthorizedToReadHistoryAndTenants() { CompositePermissionCheck necessaryPermissionsForOptimize = new PermissionCheckBuilder() .conjunctive() .atomicCheckForResourceId(PROCESS_DEFINITION, ANY, READ_HISTORY) .atomicCheckForResourceId(DECISION_DEFINITION, ANY, READ_HISTORY) .atomicCheckForResourceId(TENANT, ANY, READ) .build(); getAuthorizationManager().checkAuthorization(necessaryPermissionsForOptimize); }
Source:
private void appendQueryParameter(String key, Object paramValue, StringBuilder stringBuilder) throws UnsupportedEncodingException { if (paramValue instanceof String) { stringBuilder.append(URLEncoder.encode(key, "UTF-8")); stringBuilder.append("="); stringBuilder.append(URLEncoder.encode((String) paramValue, "UTF-8")); } else if (paramValue.getClass().isArray()) { Class ofArray = paramValue.getClass().getComponentType(); if (ofArray.isPrimitive()) { int length = Array.getLength(paramValue); for (int i = 0; i < length; i++) { appendQueryParameter(key, Array.get(paramValue, i).toString(), stringBuilder); if (i < length - 1) { stringBuilder.append("&"); } } } else { Object[] zeArray = (Object[]) paramValue; for (int i = 0; i < zeArray.length; i++) { appendQueryParameter(key, zeArray[i].toString(), stringBuilder); if (i < zeArray.length - 1) { stringBuilder.append("&"); } } } } else if (paramValue instanceof Collection) { Collection zeCollection = (Collection) paramValue; int index = 0; for (Object paramValueElement : zeCollection) { appendQueryParameter(key, paramValueElement.toString(), stringBuilder); if (index < zeCollection.size() - 1) { stringBuilder.append("&"); } index++; } } else { appendQueryParameter(key, paramValue.toString(), stringBuilder); } }

Target:
private void appendQueryParameter(String key, Object paramValue, StringBuilder stringBuilder) throws UnsupportedEncodingException { if (paramValue instanceof String) { stringBuilder.append(URLEncoder.encode(key, "UTF-8")); stringBuilder.append('='); stringBuilder.append(URLEncoder.encode((String) paramValue, "UTF-8")); } else if (paramValue.getClass().isArray()) { Class ofArray = paramValue.getClass().getComponentType(); if (ofArray.isPrimitive()) { int length = Array.getLength(paramValue); for (int i = 0; i < length; i++) { appendQueryParameter(key, Array.get(paramValue, i).toString(), stringBuilder); if (i < length - 1) { stringBuilder.append('&'); } } } else { Object[] zeArray = (Object[]) paramValue; for (int i = 0; i < zeArray.length; i++) { appendQueryParameter(key, zeArray[i].toString(), stringBuilder); if (i < zeArray.length - 1) { stringBuilder.append('&'); } } } } else if (paramValue instanceof Collection) { Collection zeCollection = (Collection) paramValue; int index = 0; for (Object paramValueElement : zeCollection) { appendQueryParameter(key, paramValueElement.toString(), stringBuilder); if (index < zeCollection.size() - 1) { stringBuilder.append('&'); } index++; } } else { appendQueryParameter(key, paramValue.toString(), stringBuilder); } }
Source:
public static String joinWithSeparator(Iterable<?> strings) { return org.apache.hadoop.util.StringUtils.join("]", strings); }

Target:
public static String joinWithSeparator(Iterable<?> strings) { return org.apache.hadoop.util.StringUtils.join(TXN_WRITE_EVENT_FILE_SEPARATOR, strings); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CustomFieldDefinition that = (CustomFieldDefinition) o; if (id != that.id) { return false; } return true; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CustomFieldDefinition that = (CustomFieldDefinition) o; if (id != null ? !id.equals(that.id) : that.id != null) return false; return true; }
Source:
public static ImmutableSortedMap<String, HashCode> parseClassHashes(List<String> lines) { Map<String, HashCode> classNames = new HashMap<>(); for (String line : lines) { int index = line.trim().lastIndexOf(CLASS_NAME_HASH_CODE_SEPARATOR); String key = line.substring(0, index); HashCode value = HashCode.fromString(line.substring(index + 1)); HashCode existing = classNames.putIfAbsent(key, value); if (existing != null && !existing.equals(value)) { throw new IllegalArgumentException( String.format( "Multiple entries with same key but differing values: %1$s=%2$s and %1$s=%3$s", key, value, existing)); } } return ImmutableSortedMap.copyOf(classNames, Ordering.natural()); }

Target:
public static ImmutableSortedMap<String, HashCode> parseClassHashes(List<String> lines) { Map<String, HashCode> classNames = new HashMap<>(); for (String line : lines) { int index = line.lastIndexOf(CLASS_NAME_HASH_CODE_SEPARATOR); Preconditions.checkArgument(index > 0, "Class names and hashcodes malformed: %1$s", line); String key = line.substring(0, index); HashCode value = HashCode.fromString(line.substring(index + 1)); HashCode existing = classNames.putIfAbsent(key, value); if (existing != null && !existing.equals(value)) { throw new IllegalArgumentException( String.format( "Multiple entries with same key but differing values: %1$s=%2$s and %1$s=%3$s", key, value, existing)); } } return ImmutableSortedMap.copyOf(classNames, Ordering.natural()); }
Source:
private void push(Repository repo, ReplicaPushRequest req) throws NotSupportedException, TransportException, IOException { Map<String, Ref> adv; List<RemoteCommand> cmds = asUpdateList(req.getCommands()); Transport tn = Transport.open(repo, uri); try { RemoteConfig rc = getRemoteConfig(); if (rc != null) { tn.applyConfig(rc); } tn.setPushAtomic(true); adv = push(repo, tn, cmds); } finally { tn.close(); } for (RemoteCommand c : cmds) { c.copyStatusToResult(); } req.setRefs(adv); }

Target:
private void push(Repository repo, ReplicaPushRequest req) throws NotSupportedException, TransportException, IOException { Map<String, Ref> adv; List<RemoteCommand> cmds = asUpdateList(req.getCommands()); try (Transport transport = Transport.open(repo, uri)) { RemoteConfig rc = getRemoteConfig(); if (rc != null) { transport.applyConfig(rc); } transport.setPushAtomic(true); adv = push(repo, transport, cmds); } for (RemoteCommand c : cmds) { c.copyStatusToResult(); } req.setRefs(adv); }
Source:
public AggStatsProcessor(final SleepStatsDAODynamoDB sleepStatsDAODynamoDB, final PillDataDAODynamoDB pillDataDAODynamoDB, final DeviceDataDAODynamoDB deviceDataDAODynamoDB, final SenseColorDAO senseColorDAO, final CalibrationDAO calibrationDAO, final AggStatsDAODynamoDB aggStatsDAODynamoDB) { this.sleepStatsDAODynamoDB = sleepStatsDAODynamoDB; this.pillDataDAODynamoDB = pillDataDAODynamoDB; this.deviceDataDAODynamoDB = deviceDataDAODynamoDB; this.senseColorDAO = senseColorDAO; this.calibrationDAO = calibrationDAO; this.aggStatsDAODynamoDB = aggStatsDAODynamoDB; }

Target:
private AggStatsProcessor(final SleepStatsDAODynamoDB sleepStatsDAODynamoDB, final PillDataDAODynamoDB pillDataDAODynamoDB, final DeviceDataDAODynamoDB deviceDataDAODynamoDB, final SenseColorDAO senseColorDAO, final CalibrationDAO calibrationDAO, final AggStatsDAODynamoDB aggStatsDAODynamoDB) { this.sleepStatsDAODynamoDB = sleepStatsDAODynamoDB; this.pillDataDAODynamoDB = pillDataDAODynamoDB; this.deviceDataDAODynamoDB = deviceDataDAODynamoDB; this.senseColorDAO = senseColorDAO; this.calibrationDAO = calibrationDAO; this.aggStatsDAODynamoDB = aggStatsDAODynamoDB; }
Source:
public void deleteGroupUnauthorizedTest() throws Exception { GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); Group parentGroup = null; try { context.turnOffAuthorisationSystem(); parentGroup = groupService.create(context); context.commit(); parentGroup = context.reloadEntity(parentGroup); String authToken = getAuthToken(admin.getEmail(), password); getClient(authToken).perform( get("/api/eperson/groups/" + parentGroup.getID()) ).andExpect(status().isOk()); getClient().perform( delete("/api/eperson/groups/" + parentGroup.getID()) ).andExpect(status().isUnauthorized()); getClient(authToken).perform( get("/api/eperson/groups/" + parentGroup.getID()) ).andExpect(status().isOk()); } finally { if (parentGroup != null) { GroupBuilder.deleteGroup(parentGroup.getID()); } } }

Target:
public void deleteGroupUnauthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); Group parentGroup = GroupBuilder.createGroup(context) .withName("test group") .build(); context.restoreAuthSystemState(); String authToken = getAuthToken(admin.getEmail(), password); getClient(authToken).perform( get("/api/eperson/groups/" + parentGroup.getID()) ).andExpect(status().isOk()); getClient().perform( delete("/api/eperson/groups/" + parentGroup.getID()) ).andExpect(status().isUnauthorized()); getClient(authToken).perform( get("/api/eperson/groups/" + parentGroup.getID()) ).andExpect(status().isOk()); }
Source:
public void emitTuples() { if (tupleCount < totalTupleCount) { DateFormat dateFormat = new SimpleDateFormat("dd/mm/yyyy"); Date date = new Date(); String xmlSample = "<?xml version=\"1.0\"?>" + "<EmployeeBean>" + "<name>employee" + tupleCount + "</name>" + "<dept>department" + tupleCount + "</dept>" + "<eid>" + tupleCount +"</eid>" + "<dateOfJoining>2015-01-01</dateOfJoining>" + "<address>" + "<city>new york</city>" +"<country>US</country>" + "</address>" + "</EmployeeBean>"; System.out.println(xmlSample); output.emit(xmlSample); tupleCount++; } }

Target:
public void emitTuples() { if (tupleCount < totalTupleCount) { StringBuilder xmlSample = new StringBuilder(); xmlSample.append("<?xml version=\"1.0\"?>"); xmlSample.append("<EmployeeBean>"); xmlSample.append("<name>employee" + tupleCount + "</name>"); xmlSample.append("<dept>department"+ tupleCount + "</dept>"); xmlSample.append("<eid>" + tupleCount +"</eid>"); xmlSample.append("<dateOfJoining>2015-01-01</dateOfJoining>"); xmlSample.append("<address>"+ "<city>new york</city>"); xmlSample.append("<country>US</country>" +"</address>"); xmlSample.append("</EmployeeBean>"); output.emit(xmlSample.toString()); tupleCount++; } }
Source:
public static S3WriterConfiguration detectWriterConfiguration(Config s3) { S3WriterConfiguration s3Configuration = null; try { s3Configuration = mapper.readValue(s3.root().render(ConfigRenderOptions.concise()), S3WriterConfiguration.class); if(!s3Configuration.getWriterPath().endsWith("/")) { s3Configuration.setWriterPath(s3Configuration.getWriterPath() + "/"); } } catch (Exception e) { e.printStackTrace(); LOGGER.warn("Could not parse S3Configuration"); } return s3Configuration; }

Target:
public static S3WriterConfiguration detectWriterConfiguration(Config s3) { S3WriterConfiguration s3Configuration = null; try { s3Configuration = mapper.readValue(s3.root().render(ConfigRenderOptions.concise()), S3WriterConfiguration.class); if(!s3Configuration.getWriterPath().endsWith("/")) { s3Configuration.setWriterPath(s3Configuration.getWriterPath() + "/"); } } catch (Exception e) { LOGGER.warn("Could not parse S3Configuration", e); } return s3Configuration; }
Source:
public void testDelete() { Mono<LongIdDomainPartition> saveMono = this.repository.save(DOMAIN_1); StepVerifier.create(saveMono).thenConsumeWhile(domain -> true).expectComplete().verify(); Mono<Void> deleteMono = this.repository.delete(DOMAIN_1); StepVerifier.create(deleteMono).verifyComplete(); Mono<Long> countMono = repository.count(); StepVerifier.create(countMono).expectNext(1L).verifyComplete(); }

Target:
public void testDelete() { Mono<LongIdDomainPartition> saveMono = this.repository.save(DOMAIN_1); StepVerifier.create(saveMono).expectNext(DOMAIN_1).expectComplete().verify(); Mono<Void> deleteMono = this.repository.delete(DOMAIN_1); StepVerifier.create(deleteMono).verifyComplete(); Mono<Long> countMono = repository.count(); StepVerifier.create(countMono).expectNext(1L).verifyComplete(); }
Source:
private Resource loadResource(String name) throws IOException { Path p = staticBase.resolve(name); try { p = p.toRealPath().normalize(); } catch (IOException e) { return Resource.NOT_FOUND; } if (!p.startsWith(staticBase)) { return Resource.NOT_FOUND; } long ts = Files.getLastModifiedTime(p).toMillis(); byte[] raw; try (InputStream in = Files.newInputStream(p)) { raw = ByteStreams.toByteArray(in); } catch (FileNotFoundException e) { return Resource.NOT_FOUND; } return new Resource(p, ts, contentType(name), raw); }

Target:
private Resource loadResource(String name) throws IOException { Path p = staticBase.resolve(name); try { p = p.toRealPath().normalize(); } catch (IOException e) { return Resource.NOT_FOUND; } if (!p.startsWith(staticBase)) { return Resource.NOT_FOUND; } long ts = FileUtil.lastModified(p); byte[] raw; try { raw = Files.readAllBytes(p); } catch (NoSuchFileException e) { return Resource.NOT_FOUND; } return new Resource(p, ts, contentType(name), raw); }
Source:
public void retrieve(@PathVariable UUID uuid, HttpServletResponse response, HttpServletRequest request) throws IOException, SQLException { Context context = ContextUtil.obtainContext(request); Bitstream bit = getBitstreamIfAuthorized(context, uuid, response); if (bit == null) { return; } Long lastModified = bitstreamService.getLastModified(bit); String mimetype = bit.getFormat(context).getMIMEType(); try(InputStream is = getInputStream(context, bit)) { MultipartFileSender sender = MultipartFileSender .fromInputStream(is) .withBufferSize(bufferSize) .withFileName(bit.getName()) .withLength(bit.getSize()) .withChecksum(bit.getChecksum()) .withMimetype(mimetype) .withLastModified(lastModified) .with(request) .with(response); if (sender.isValid()) { sender.serveResource(); } if (sender.isNoRangeRequest() && isNotAnErrorResponse(response)) { eventService.fireEvent( new UsageEvent( UsageEvent.Action.VIEW, request, context, bit)); } } catch(IOException ex) { log.debug("Client aborted the request before the download was completed. Client is probably switching to a Range request.", ex); } catch (Exception e) { log.error(e.getMessage(), e); response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage()); } }

Target:
public void retrieve(@PathVariable UUID uuid, HttpServletResponse response, HttpServletRequest request) throws IOException, SQLException, AuthorizeException { Context context = ContextUtil.obtainContext(request); Bitstream bit = getBitstream(context, uuid, response); if (bit == null) { return; } Long lastModified = bitstreamService.getLastModified(bit); String mimetype = bit.getFormat(context).getMIMEType(); try(InputStream is = bitstreamService.retrieve(context, bit)) { MultipartFileSender sender = MultipartFileSender .fromInputStream(is) .withBufferSize(BUFFER_SIZE) .withFileName(bit.getName()) .withLength(bit.getSize()) .withChecksum(bit.getChecksum()) .withMimetype(mimetype) .withLastModified(lastModified) .with(request) .with(response); if (sender.isNoRangeRequest() && isNotAnErrorResponse(response)) { eventService.fireEvent( new UsageEvent( UsageEvent.Action.VIEW, request, context, bit)); } context.complete(); if (sender.isValid()) { sender.serveResource(); } } catch(ClientAbortException ex) { log.debug("Client aborted the request before the download was completed. Client is probably switching to a Range request.", ex); } }
Source:
private void signInAnonymously() { Toast.makeText(this, "Signing in...", Toast.LENGTH_SHORT).show(); mAuth.signInAnonymously() .addOnSuccessListener(this, new OnSuccessListener<AuthResult>() { @Override public void onSuccess(AuthResult result) { attachRecyclerViewAdapter(); } }) .addOnCompleteListener(new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (task.isSuccessful()) { Toast.makeText(getApplicationContext(), R.string.signed_in, Toast.LENGTH_SHORT) .show(); } else { Toast.makeText(getApplicationContext(), R.string.sign_in_failed, Toast.LENGTH_SHORT) .show(); } } }); }

Target:
private void signInAnonymously() { Toast.makeText(this, "Signing in...", Toast.LENGTH_SHORT).show(); mAuth.signInAnonymously() .addOnSuccessListener(this, new OnSuccessListener<AuthResult>() { @Override public void onSuccess(AuthResult result) { attachRecyclerViewAdapter(); } }) .addOnCompleteListener(new SignInResultNotifier(this)); }
Source:
public void runToLocation(Location location) { if (isConnected()) { for (DebuggerObserver observer : observers) { observer.onPreResume(); } removeCurrentLocation(); preserveDebuggerState(); RunToLocationActionDto action = dtoFactory .createDto(RunToLocationActionDto.class) .withType(Action.TYPE.RUN_TO_LOCATION) .withTarget(location.getTarget()) .withLineNumber(location.getLineNumber()); Promise<Void> promise = service.runToLocation(debugSessionDto.getId(), action); promise.catchError( error -> { Log.error(AbstractDebugger.class, error.getCause()); }); } }

Target:
public void runToLocation(Location location) { if (!isConnected()) { return; } if (disposableBreakpoint != null) { return; } disposableBreakpoint = dtoFactory.createDto(BreakpointDto.class).withLocation(toDto(location)).withEnabled(true); service .addBreakpoint(debugSessionDto.getId(), disposableBreakpoint) .then( it -> { preserveDebuggerState(); resume(); }) .catchError( error -> { service .deleteBreakpoint(debugSessionDto.getId(), disposableBreakpoint.getLocation()) .catchError( err -> { Log.error(AbstractDebugger.class, err.getMessage()); }); invalidateDisposableBreakpoint(); preserveDebuggerState(); }); }
Source:
public void add(RevCommit revCommit) { Assert.isNotNull(revCommit); checkWidget(); String shortSha1 = revCommit.getName().substring(0, 6); String message = shortSha1 + ": " + revCommit.getShortMessage(); combo.add(message); commits.add(new ComboCommitEnt(revCommit.getId(), message)); }

Target:
public void add(RevCommit revCommit) { Assert.isNotNull(revCommit); checkWidget(); String shortSha1 = revCommit.getName().substring(0, 8); String message = shortSha1 + ": " + revCommit.getShortMessage(); combo.add(message); commits.add(new ComboCommitEnt(revCommit.getId(), message)); }
Source:
public void initialize(DataManager manager, ARXConfiguration config){ if (beta < 0) { double epsilonAnon = epsilon - (isDataDependent() ? config.getDPSearchBudget() : 0d); ParameterCalculation pCalc = null; try { pCalc = new ParameterCalculation(epsilonAnon, delta); } catch (IntervalArithmeticException e) { throw new RuntimeException(e); } beta = pCalc.getBeta(); k = pCalc.getK(); } if (subset == null || initialized) { Random random = deterministic ? new Random(0xDEADBEEF) : new SecureRandom(); Set<Integer> subsetIndices = new HashSet<Integer>(); int numRecords = manager.getDataGeneralized().getDataLength(); for (int i = 0; i < numRecords; ++i) { if (random.nextDouble() < beta) { subsetIndices.add(i); } } this.subset = DataSubset.create(numRecords, subsetIndices); } initialized = true; }

Target:
public void initialize(DataManager manager, ARXConfiguration config){ if (beta < 0) { double epsilonAnon = epsilon; if (isDataDependent()) { try { IntervalArithmeticDouble ia = new IntervalArithmeticDouble(); epsilonAnon = ia.sub(ia.createInterval(epsilon), ia.createInterval(config.getDPSearchBudget())).lower; } catch (IntervalArithmeticException e) { throw new RuntimeException(e); } } ParameterCalculation pCalc = null; try { pCalc = new ParameterCalculation(epsilonAnon, delta); } catch (IntervalArithmeticException e) { throw new RuntimeException(e); } beta = pCalc.getBeta(); k = pCalc.getK(); } if (subset == null || initialized) { Random random = deterministic ? new Random(0xDEADBEEF) : new SecureRandom(); Set<Integer> subsetIndices = new HashSet<Integer>(); int numRecords = manager.getDataGeneralized().getDataLength(); for (int i = 0; i < numRecords; ++i) { if (random.nextDouble() < beta) { subsetIndices.add(i); } } this.subset = DataSubset.create(numRecords, subsetIndices); } initialized = true; }
Source:
public Mono<AccessToken> authenticateWithConfidentialClientCache(TokenRequestContext request) { return Mono.fromFuture(() -> { SilentParameters.SilentParametersBuilder parametersBuilder = SilentParameters.builder( new HashSet<>(request.getScopes())); try { return getConfidentialClientApplication().acquireTokenSilently(parametersBuilder.build()); } catch (MalformedURLException e) { return getFailedCompletableFuture(logger.logExceptionAsError(Exceptions.propagate(e))); } }).map(ar -> (AccessToken) new MsalToken(ar, options)) .filter(t -> !t.isExpired()); }

Target:
public Mono<AccessToken> authenticateWithConfidentialClientCache(TokenRequestContext request) { return Mono.fromFuture(() -> { SilentParameters.SilentParametersBuilder parametersBuilder = SilentParameters.builder( new HashSet<>(request.getScopes())); try { return getConfidentialClientApplication().acquireTokenSilently(parametersBuilder.build()); } catch (MalformedURLException e) { return getFailedCompletableFuture(logger.logExceptionAsError(new RuntimeException(e))); } }).map(ar -> (AccessToken) new MsalToken(ar, options)) .filter(t -> !t.isExpired()); }
Source:
public Result updateEmail() { JsonNode json = request().body().asJson(); if (!validateUpdateEmailParameters(json)) { return badRequest(EMAIL_EXPECTED); } String actualEmail = session().get(ConstantsManager.COOKIE_SESSION_FIELD_NAME); String newEmail = json.get(ConstantsManager.USERNAME_FIELD_NAME).asText(); try { User user = userDao.findByEmail(actualEmail); user.setEmail(newEmail); userDao.update(user); session().put(ConstantsManager.COOKIE_SESSION_FIELD_NAME, newEmail); return ok(); } catch (RecordNotFoundException e) { return unauthorized(BAD_SESSION_WRONG_USERNAME); } catch (ValidationException e) { return unauthorized(EMAIL_SHOULD_BE_UNIQUE); } }

Target:
public Result updateEmail() { JsonNode json = request().body().asJson(); if (!validateUpdateEmailParameters(json)) { return badRequest(EMAIL_EXPECTED); } String actualEmail = session().get(ConstantsManager.COOKIE_SESSION_FIELD_NAME); String newEmail = json.get(ConstantsManager.USERNAME_FIELD_NAME).asText(); try { User user = userDao.findByEmail(actualEmail); user.setEmail(newEmail); userDao.update(user); session().put(ConstantsManager.COOKIE_SESSION_FIELD_NAME, newEmail); return ok(); } catch (RecordNotFoundException e) { return unauthorized(BAD_SESSION_WRONG_USERNAME); } catch (UniqueValidationException e) { return unauthorized(EMAIL_SHOULD_BE_UNIQUE); } catch (ConstraintViolationException e) { return unauthorized(EMAIL_IS_INVALID); } }
Source:
public void nextJsonObject_SingleElement() throws JsonParseException, IOException { String content = normalizeJson("{bre: 'sss', arr:['1112', 'abc']}"); JsonParser jsonParser = jsonFactory.createParser(content); JsonToken jsonToken = jsonUtils.nextJsonObject(jsonParser); assertNotNull(jsonToken); assertEquals(content.replaceAll("\\s", ""), jsonParser.readValueAsTree().toString()); assertNull(jsonUtils.nextJsonObject(jsonParser)); }

Target:
public void nextJsonObject_SingleElement() throws JsonParseException, IOException { String content = normalizeJson("{bre: 'sss', arr:['1112', 'abc']}"); JsonParser jsonParser = jsonFactory.createParser(content); JsonToken jsonToken = jsonUtils.nextJsonObject(jsonParser); assertNotNull(jsonToken); assertEquals(content, jsonParser.readValueAsTree().toString()); assertNull(jsonUtils.nextJsonObject(jsonParser)); }
Source:
public void onPlayerJoin(PlayerJoinEvent event) { skinUpdateTracker.updatePlayer(event.getPlayer(), 6 * 20, true); for (NPC npc : getAllNPCs()) { String teamName = npc.data().get(NPC.SCOREBOARD_FAKE_TEAM_NAME_METADATA, ""); Team team = null; if (!(npc.getEntity() instanceof Player) || teamName.length() == 0 || (team = Bukkit.getScoreboardManager().getMainScoreboard().getTeam(teamName)) == null) return; if (Setting.USE_SCOREBOARD_TEAMS.asBoolean()) { NMS.sendTeamPacket(event.getPlayer(), team); } } }

Target:
public void onPlayerJoin(PlayerJoinEvent event) { skinUpdateTracker.updatePlayer(event.getPlayer(), 6 * 20, true); if (Setting.USE_SCOREBOARD_TEAMS.asBoolean()) { for (NPC npc : getAllNPCs()) { if (!(npc.getEntity() instanceof Player)) { continue; } String teamName = npc.data().get(NPC.SCOREBOARD_FAKE_TEAM_NAME_METADATA, ""); Team team = null; if (teamName.length() == 0 || (team = Bukkit.getScoreboardManager().getMainScoreboard().getTeam(teamName)) == null) continue; NMS.sendTeamPacket(event.getPlayer(), team); } } }
Source:
public static List<Path> listDirectoryFiles(Path dir) throws IOException { try (DirectoryStream<Path> entries = Files.newDirectoryStream(dir, FILE_FILTER)) { return Lists.newArrayList(entries); } }

Target:
public static List<Path> listDirectoryFiles(Path dir) throws IOException { try (DirectoryStream<Path> entries = Files.newDirectoryStream(dir, regularFileFilter())) { return Lists.newArrayList(entries); } }
Source:
public static String formatDate(Date dateToformat) { try { DataverseLocaleBean d = new DataverseLocaleBean(); Locale bundle_locale = new Locale(d.getLocaleCode()); String formattedDate = ""; if(bundle_locale.getLanguage().contains("fr")) { DateFormat df = new SimpleDateFormat("dd MMM yyyy",bundle_locale); formattedDate = df.format(dateToformat); } else { DateFormat df = new SimpleDateFormat("MMM dd, yyyy", bundle_locale); formattedDate = df.format(dateToformat); } return formattedDate; } catch(Exception e) { return null; } }

Target:
public static String formatDate(Date dateToformat) { String formattedDate; DateFormat dateFormatter; try { DataverseLocaleBean d = new DataverseLocaleBean(); Locale currentLocale = new Locale(d.getLocaleCode()); dateFormatter = DateFormat.getDateInstance(DateFormat.DEFAULT, currentLocale); formattedDate = dateFormatter.format(dateToformat); return formattedDate; } catch(Exception e) { return null; } }
Source:
public OvsdbVtepBackend(OvsdbClient client) throws Exception { this.client = client; this.endPoint = endPointFromOvsdbClient(client); try { DatabaseSchema dbs = getDbSchema( client, DB_HARDWARE_VTEP).result(Duration.Inf()); this.lsTable = new LogicalSwitchTable( dbs, getTblSchema(dbs, TB_LOGICAL_SWITCH)); this.psTable = new PhysicalSwitchTable( dbs, getTblSchema(dbs, TB_PHYSICAL_SWITCH)); this.plSetTable = new PhysicalLocatorSetTable( dbs, getTblSchema(dbs, TB_PHYSICAL_LOCATOR_SET)); this.plTable = new PhysicalLocatorTable( dbs, getTblSchema(dbs, TB_PHYSICAL_LOCATOR)); this.uMacsLocalTable = new UcastMacsTable( dbs, getTblSchema(dbs, TB_UCAST_MACS_LOCAL)); this.uMacsRemoteTable = new UcastMacsTable( dbs, getTblSchema(dbs, TB_UCAST_MACS_REMOTE)); this.mMacsLocalTable = new McastMacsTable( dbs, getTblSchema(dbs, TB_MCAST_MACS_LOCAL)); this.mMacsRemoteTable = new McastMacsTable( dbs, getTblSchema(dbs, TB_MCAST_MACS_REMOTE)); this.pSwitch = retrievePhysicalSwitch(this.endPoint.mgmtIp()); } catch(NoSuchElementException exc) { throw new VtepUnsupportedException(this.endPoint, exc); } catch(TimeoutException tOut) { throw new VtepException(this.endPoint, tOut); } }

Target:
public OvsdbVtepBackend(OvsdbClient client) throws Exception { this.client = client; this.endPoint = endPointFromOvsdbClient(client); try { DatabaseSchema dbs = getDbSchema( client, DB_HARDWARE_VTEP).result(Duration.Inf()); this.lsTable = new LogicalSwitchTable(dbs); this.psTable = new PhysicalSwitchTable(dbs); this.plSetTable = new PhysicalLocatorSetTable(dbs); this.plTable = new PhysicalLocatorTable(dbs); this.uMacsLocalTable = new UcastMacsLocalTable(dbs); this.uMacsRemoteTable = new UcastMacsRemoteTable(dbs); this.mMacsLocalTable = new McastMacsLocalTable(dbs); this.mMacsRemoteTable = new McastMacsRemoteTable(dbs); this.pSwitch = retrievePhysicalSwitch(this.endPoint.mgmtIp()); } catch(NoSuchElementException exc) { throw new VtepUnsupportedException(this.endPoint, exc); } catch(TimeoutException tOut) { throw new VtepException(this.endPoint, tOut); } }
Source:
public void fillCommonCourtFieldsToItemRepresentation(Item item, CommonCourt court){ item.setId(court.getId()); item.setName(court.getName()); item.setType(court.getType()); item.setCode(court.getCode()); if(court.getParentCourt()!=null){ DumpCourtsView.ParentCourt parentCourt = new DumpCourtsView.ParentCourt(); parentCourt.setId(court.getParentCourt().getId()); item.setParentCourt(parentCourt); } item.setDivisions(toDivisions(court.getDivisions())); }

Target:
public void fillCommonCourtFieldsToItemRepresentation(Item item, CommonCourt court){ item.setId(court.getId()); item.setName(court.getName()); item.setType(court.getType()); item.setCode(court.getCode()); item.setParentCourt(toParentCourt(court.getParentCourt())); item.setDivisions(toDivisions(court.getDivisions())); }
Source:
public MavenDependencyResolver() { this(System.getProperty("robolectric.dependency.repo.url", "<LINK_0>"), System.getProperty("robolectric.dependency.repo.id", "sonatype")); }

Target:
public MavenDependencyResolver() { this(RoboSettings.getMavenRepositoryUrl(), RoboSettings.getMavenRepositoryId()); }
Source:
public DelegatingResourceDescription getRepresentationDescription(Representation representation) { if (representation instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("diagnosis"); description.addProperty("patient", Representation.REF); description.addProperty("condition"); description.addProperty("encounter"); description.addProperty("certainty"); description.addProperty("rank"); description.addProperty("voided"); description.addProperty("display"); description.addSelfLink(); return description; } else if (representation instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("diagnosis"); description.addProperty("patient", Representation.REF); description.addProperty("condition"); description.addProperty("encounter"); description.addProperty("certainty"); description.addProperty("rank"); description.addProperty("voided"); description.addProperty("auditInfo"); description.addProperty("display"); description.addSelfLink(); return description; } return null; }

Target:
public DelegatingResourceDescription getRepresentationDescription(Representation representation) { if (representation instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("diagnosis", Representation.REF); description.addProperty("condition", Representation.REF); description.addProperty("encounter", Representation.REF); description.addProperty("certainty"); description.addProperty("rank"); description.addProperty("voided"); description.addProperty("display"); description.addProperty("patient", Representation.REF); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); description.addSelfLink(); return description; } else if (representation instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("diagnosis"); description.addProperty("patient", Representation.REF); description.addProperty("condition"); description.addProperty("encounter"); description.addProperty("certainty"); description.addProperty("rank"); description.addProperty("voided"); description.addProperty("auditInfo"); description.addProperty("display"); description.addSelfLink(); return description; } return null; }
Source:
public KafkaWriterFactory( @JsonProperty("producerConfig") @Nonnull Map<String, Object> producerConfig, @JsonProperty("topic") @Nonnull String topic, @JsonProperty("resultSerializer") ResultSerializer resultSerializer) { this.objectMapper = new ObjectMapper(); checkNotNull(producerConfig); ImmutableMap.Builder<String, Object> producerConfigBuilder = ImmutableMap.<String, Object>builder() .putAll(producerConfig); if (!producerConfig.containsKey(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG)) { producerConfigBuilder.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, STRING_SERIALIZER_CLASS); } if (!producerConfig.containsKey(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG)) { producerConfigBuilder.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, STRING_SERIALIZER_CLASS); } this.producerConfig = producerConfigBuilder.build(); this.topic = topic; checkNotNull(topic); this.resultSerializer = resultSerializer == null ? new DefaultResultSerializer( Collections.<String>emptyList(), false, "", Collections.<String,String> emptyMap()) : resultSerializer; }

Target:
public KafkaWriterFactory( @JsonProperty("producerConfig") @Nonnull Map<String, Object> producerConfig, @JsonProperty("topic") @Nonnull String topic, @JsonProperty("resultSerializer") ResultSerializer resultSerializer) { this.objectMapper = new ObjectMapper(); ImmutableMap.Builder<String, Object> producerConfigBuilder = ImmutableMap.<String, Object>builder() .putAll(producerConfig); if (!producerConfig.containsKey(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG)) { producerConfigBuilder.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, STRING_SERIALIZER_CLASS); } if (!producerConfig.containsKey(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG)) { producerConfigBuilder.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, STRING_SERIALIZER_CLASS); } this.producerConfig = producerConfigBuilder.build(); this.topic = topic; checkNotNull(topic); this.resultSerializer = resultSerializer == null ? new DefaultResultSerializer( Collections.<String>emptyList(), false, "", Collections.<String, String>emptyMap()) : resultSerializer; }
Source:
public static String formatForUtcTime(final Date date) { final DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT); dateFormat.setTimeZone(TimeZone.getTimeZone(TIMEZONE)); return dateFormat.format(date); }

Target:
public static String formatForUtcTime(final Date date) { return createDateFormat().format(date); }
Source:
private ClouderaManagerClusterConfigurationMonitor getConfigurationChangeMonitor() { ClouderaManagerClusterConfigurationMonitor cmMonitor = null; try { Class<?> clazz = Class.forName(GATEWAY_SERVICES_ACCESSOR_CLASS); if (clazz != null) { Method m = clazz.getDeclaredMethod(GATEWAY_SERVICES_ACCESSOR_METHOD); if (m != null) { Object obj = m.invoke(null); if (GatewayServices.class.isAssignableFrom(obj.getClass())) { ClusterConfigurationMonitorService clusterMonitorService = ((GatewayServices) obj).getService(ServiceType.CLUSTER_CONFIGURATION_MONITOR_SERVICE); ClusterConfigurationMonitor monitor = clusterMonitorService.getMonitor(ClouderaManagerClusterConfigurationMonitor.getType()); if (monitor != null && ClouderaManagerClusterConfigurationMonitor.class.isAssignableFrom(monitor.getClass())) { cmMonitor = (ClouderaManagerClusterConfigurationMonitor) monitor; } } } } } catch (Exception e) { log.errorAccessingConfigurationChangeMonitor(e); } return cmMonitor; }

Target:
private ClouderaManagerClusterConfigurationMonitor getConfigurationChangeMonitor() { ClouderaManagerClusterConfigurationMonitor cmMonitor = null; try { GatewayServices gwServices = GatewayServer.getGatewayServices(); if (gwServices != null) { ClusterConfigurationMonitorService clusterMonitorService = GatewayServer.getGatewayServices().getService(ServiceType.CLUSTER_CONFIGURATION_MONITOR_SERVICE); ClusterConfigurationMonitor monitor = clusterMonitorService.getMonitor(ClouderaManagerClusterConfigurationMonitor.getType()); if (monitor != null && ClouderaManagerClusterConfigurationMonitor.class.isAssignableFrom(monitor.getClass())) { cmMonitor = (ClouderaManagerClusterConfigurationMonitor) monitor; } } } catch (Exception e) { log.errorAccessingConfigurationChangeMonitor(e); } return cmMonitor; }
Source:
private Object toValue(final Object baseInstance, final JsonValue jsonValue, final Adapter converter, final Adapter itemConverter, final Type type, final ObjectConverter.Reader objectConverter, final JsonPointerTracker jsonPointer, final Type rootType) { if (objectConverter != null) { if (EnumSet.of(ValueType.OBJECT, ValueType.NUMBER, ValueType.STRING, ValueType.FALSE, ValueType.TRUE).contains(jsonValue.getValueType())) { return objectConverter.fromJson(jsonValue, type, this); } else if (jsonValue instanceof JsonArray) { return buildArray(type, jsonValue.asJsonArray(), itemConverter, objectConverter, jsonPointer, rootType); } else { throw new UnsupportedOperationException("Array handling with ObjectConverter currently not implemented"); } } try { return converter == null ? toObject(baseInstance, jsonValue, type, itemConverter, jsonPointer, rootType) : jsonValue.getValueType() == JsonValue.ValueType.STRING ? converter.to(JsonString.class.cast(jsonValue).getString()) : convertTo(converter, jsonValue, jsonPointer); } catch (Exception e) { if (e instanceof MapperException) { throw e; } throw new MapperException(e); } }

Target:
private Object toValue(final Object baseInstance, final JsonValue jsonValue, final Adapter converter, final Adapter itemConverter, final Type type, final ObjectConverter.Reader objectConverter, final JsonPointerTracker jsonPointer, final Type rootType) { if (objectConverter != null) { if (jsonValue instanceof JsonArray) { return buildArray(type, jsonValue.asJsonArray(), itemConverter, objectConverter, jsonPointer, rootType); } else { return objectConverter.fromJson(jsonValue, type, this); } } try { return converter == null ? toObject(baseInstance, jsonValue, type, itemConverter, jsonPointer, rootType) : jsonValue.getValueType() == JsonValue.ValueType.STRING ? converter.to(JsonString.class.cast(jsonValue).getString()) : convertTo(converter, jsonValue, jsonPointer); } catch (Exception e) { if (e instanceof MapperException) { throw e; } throw new MapperException(e); } }
Source:
private String read(BitBuffer input) throws CTFReaderException { alignRead(input); StringBuilder sb = new StringBuilder(); char c = (char) input.get(BITS_PER_BYTE, false); while (c != 0) { sb.append(c); c = (char) input.get(BITS_PER_BYTE, false); } @SuppressWarnings("null") @NonNull String string = sb.toString(); return string; }

Target:
private String read(BitBuffer input) throws CTFReaderException { alignRead(input); StringBuilder sb = new StringBuilder(); char c = (char) input.get(BITS_PER_BYTE, false); while (c != 0) { sb.append(c); c = (char) input.get(BITS_PER_BYTE, false); } return NonNullUtils.checkNotNull(sb.toString()); }
Source:
public String Nc4Version() { try { Class com_sun_jan_Native = Class.forName("com.sun.jna.Native"); Method loadLibrary_method = com_sun_jan_Native.getMethod("loadLibrary", String.class, Class.class); Object nc4 = loadLibrary_method.invoke(null, "netcdf", Nc4prototypes.class); Method nc_inq_libvers_method = Nc4prototypes.class.getMethod("nc_inq_libvers"); String version = (String) nc_inq_libvers_method.invoke(nc4); return version; } catch (Exception e) { return "unavailable (" + e.getClass() + ":" + e.getMessage() + ")"; } }

Target:
public String Nc4Version() { try { Class jnaNativeClass = Class.forName("com.sun.jna.Native"); Method loadLibraryMethod = jnaNativeClass.getMethod("loadLibrary", String.class, Class.class); Object nc4 = loadLibraryMethod.invoke(null, "netcdf", Nc4prototypes.class); Method nc_inq_libversMethod = Nc4prototypes.class.getMethod("nc_inq_libvers"); String version = (String) nc_inq_libversMethod.invoke(nc4); return version; } catch (Exception e) { return "unavailable (" + e.getClass() + ":" + e.getMessage() + ")"; } }
Source:
public void setUp() throws SlickException { Image mockedImage = Mockito.mock(Image.class); Mockito.when(mockedImage.getWidth()).thenReturn(5); Mockito.when(mockedImage.getHeight()).thenReturn(5); mockedResources = Mockito.mock(ResourcesWrapper.class); Mockito.when(mockedResources.getTitleScreenBackground()).thenReturn(mockedImage); state = new StartScreenState(mockedResources); mockedController = Mockito.mock(StartScreenStateController.class); state.setController(mockedController); mockedMouseOverArea = Mockito.mock(MouseOverArea.class); Mockito.when(mockedController.createPlayer1Button(Mockito.any())).thenReturn( mockedMouseOverArea); Mockito.when(mockedController.createPlayer2Button(Mockito.any())).thenReturn( mockedMouseOverArea); Mockito.when(mockedController.createOptionsButton(Mockito.any())).thenReturn( mockedMouseOverArea); Mockito.when(mockedController.createHighscoresButton(Mockito.any())).thenReturn( mockedMouseOverArea); Mockito.when(mockedController.createQuitButton(Mockito.any())).thenReturn( mockedMouseOverArea); mockedFont = Mockito.mock(TrueTypeFont.class); Mockito.when(mockedResources.createFont(new Font("Verdana", Font.BOLD, 36), true)) .thenReturn(mockedFont); state.setResources(mockedResources); mockedInput = Mockito.mock(Input.class); state.setInputForTesting(mockedInput); mockedContainer = Mockito.mock(GameContainer.class); Mockito.when(mockedContainer.getInput()).thenReturn(mockedInput); mockedSBG = Mockito.mock(StateBasedGame.class); }

Target:
public void setUp() throws SlickException { Image mockedImage = Mockito.mock(Image.class); Mockito.when(mockedImage.getWidth()).thenReturn(5); Mockito.when(mockedImage.getHeight()).thenReturn(5); mockedResources = Mockito.mock(ResourcesWrapper.class); Mockito.when(mockedResources.getTitleScreenBackground()).thenReturn(mockedImage); state = new StartScreenState(mockedResources); mockedController = Mockito.mock(StartScreenStateController.class); state.setController(mockedController); mockedMouseOverArea = Mockito.mock(MouseOverArea.class); Mockito.when(mockedController.createPlayer1Button(Mockito.any())).thenReturn( mockedMouseOverArea); Mockito.when(mockedController.createPlayer2Button(Mockito.any())).thenReturn( mockedMouseOverArea); Mockito.when(mockedController.createOptionsButton(Mockito.any())).thenReturn( mockedMouseOverArea); Mockito.when(mockedController.createHighscoresButton(Mockito.any())).thenReturn( mockedMouseOverArea); Mockito.when(mockedController.createQuitButton(Mockito.any())).thenReturn( mockedMouseOverArea); mockedFont = Mockito.mock(TrueTypeFont.class); Mockito.when(mockedResources.createFont(Mockito.any(), Mockito.anyBoolean())) .thenReturn(mockedFont); state.setResources(mockedResources); mockedInput = Mockito.mock(Input.class); state.setInputForTesting(mockedInput); mockedContainer = Mockito.mock(GameContainer.class); Mockito.when(mockedContainer.getInput()).thenReturn(mockedInput); mockedSBG = Mockito.mock(StateBasedGame.class); }
Source:
private FeedbackSessionResponseStatus getFeedbackSessionResponseStatus( FeedbackSessionAttributes fsa, CourseRoster roster, List<FeedbackQuestionAttributes> questions) throws EntityDoesNotExistException { FeedbackSessionResponseStatus responseStatus = new FeedbackSessionResponseStatus(); List<StudentAttributes> students = roster.getStudents(); List<InstructorAttributes> instructors = roster.getInstructors(); List<FeedbackQuestionAttributes> studentQns = fqLogic .getFeedbackQuestionsForStudents(questions); List<String> studentNoResponses = new ArrayList<String>(); List<String> instructorNoResponses = new ArrayList<String>(); if(!studentQns.isEmpty()){ for(StudentAttributes student : students){ studentNoResponses.add(student.email); responseStatus.emailNameTable.put(student.email, student.name); responseStatus.emailTeamNameTable.put(student.email, student.team); } } studentNoResponses.removeAll(fsa.respondingStudentList); for (InstructorAttributes instructor : instructors) { List<FeedbackQuestionAttributes> instructorQns = fqLogic .getFeedbackQuestionsForInstructor(questions, fsa.isCreator(instructor.email)); if (!instructorQns.isEmpty()) { if(responseStatus.emailNameTable.get(instructor.email) == null){ instructorNoResponses.add(instructor.email); responseStatus.emailNameTable.put(instructor.email, instructor.name); } } } instructorNoResponses.removeAll(fsa.respondingInstructorList); responseStatus.noResponse.addAll(studentNoResponses); responseStatus.noResponse.addAll(instructorNoResponses); return responseStatus; }

Target:
private FeedbackSessionResponseStatus getFeedbackSessionResponseStatus( FeedbackSessionAttributes fsa, CourseRoster roster, List<FeedbackQuestionAttributes> questions) throws EntityDoesNotExistException { FeedbackSessionResponseStatus responseStatus = new FeedbackSessionResponseStatus(); List<StudentAttributes> students = roster.getStudents(); List<InstructorAttributes> instructors = roster.getInstructors(); List<FeedbackQuestionAttributes> studentQns = fqLogic .getFeedbackQuestionsForStudents(questions); List<String> studentNoResponses = new ArrayList<String>(); List<String> instructorNoResponses = new ArrayList<String>(); if(!studentQns.isEmpty()){ for(StudentAttributes student : students){ studentNoResponses.add(student.email); responseStatus.emailNameTable.put(student.email, student.name); responseStatus.emailTeamNameTable.put(student.email, student.team); } } studentNoResponses.removeAll(fsa.respondingStudentList); for (InstructorAttributes instructor : instructors) { List<FeedbackQuestionAttributes> instructorQns = fqLogic .getFeedbackQuestionsForInstructor(questions, fsa.isCreator(instructor.email)); if (!instructorQns.isEmpty()) { if(responseStatus.emailNameTable.get(instructor.email) == null){ instructorNoResponses.add(instructor.email); responseStatus.emailNameTable.put(instructor.email, instructor.name); responseStatus.emailTeamNameTable.put(instructor.email, "Teaching Team"); } } } instructorNoResponses.removeAll(fsa.respondingInstructorList); responseStatus.noResponse.addAll(studentNoResponses); responseStatus.noResponse.addAll(instructorNoResponses); return responseStatus; }
Source:
public void detach(ChannelCreationListener channelCreationListener) { this.channelCreationListener = ChannelCreationListener.NO_OP; newChannelName.removeTextChangedListener(channelNameTextWatcher); privateChannelSwitch.setOnCheckedChangeListener(null); createButton.setOnClickListener(null); }

Target:
public void detach(ChannelCreationListener channelCreationListener) { newChannelName.removeTextChangedListener(channelNameTextWatcher); privateChannelSwitch.setOnCheckedChangeListener(null); createButton.setOnClickListener(null); this.channelCreationListener = null; }