auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void initEditMode(ChangeInfo info) { if (Gerrit.isSignedIn() && info.status().isOpen()) { RevisionInfo rev = info.revision(revision); if (isEditModeEnabled(info, rev)) { editMode.setVisible(fileTableMode == FileTable.Mode.REVIEW); addFile.setVisible(!editMode.isVisible()); reviewMode.setVisible(!editMode.isVisible()); addFileAction = new AddFileAction( changeId, info.revision(revision), style, addFile); } else { editMode.setVisible(false); addFile.setVisible(false); reviewMode.setVisible(false); } <START> if (rev.is_edit()) { reply.setVisible(false); quickApprove.setVisible(false); } <END> } }</code><technical_language>This method initializes edit mode. right place initialize reply button is another method: initReplyButton() for quick approve</technical_language>

Target:
private void initEditMode(ChangeInfo info) { if (Gerrit.isSignedIn() && info.status().isOpen()) { RevisionInfo rev = info.revision(revision); if (isEditModeEnabled(info, rev)) { editMode.setVisible(fileTableMode == FileTable.Mode.REVIEW); addFile.setVisible(!editMode.isVisible()); reviewMode.setVisible(!editMode.isVisible()); addFileAction = new AddFileAction( changeId, info.revision(revision), style, addFile); } else { editMode.setVisible(false); addFile.setVisible(false); reviewMode.setVisible(false); } } }
Source:
<code>public static UploadPackLogger newChain(List<? extends UploadPackLogger> loggers) { UploadPackLogger[] newLoggers = new UploadPackLogger[loggers.size()]; int i = 0; for (UploadPackLogger logger : loggers) { <START> if (logger != UploadPackLogger.NULL) <END> newLoggers[i++] = logger; } if (i == 0) return UploadPackLogger.NULL; else if (i == 1) return newLoggers[0]; else return new UploadPackLoggerChain(newLoggers); }</code><technical_language>bug</technical_language>

Target:
public static UploadPackLogger newChain( List<? extends UploadPackLogger> loggers) { UploadPackLogger[] newLoggers = new UploadPackLogger[loggers.size()]; int i = 0; for (UploadPackLogger logger : loggers) if (logger != UploadPackLogger.NULL) newLoggers[i++] = logger; if (i == 0) return UploadPackLogger.NULL; else if (i == 1) return newLoggers[0]; else return new UploadPackLoggerChain(newLoggers, i); }
Source:
<code>public ProcessResult process(AbstractFile abstractFile) { blackboard = currentCase.getSleuthkitCase().getBlackboard(); if (abstractFile.getKnown().equals(TskData.FileKnown.KNOWN)) { return ProcessResult.OK; } if ((abstractFile.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS)) || (abstractFile.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.SLACK))) { return ProcessResult.OK; } if ((abstractFile.isFile() == false)) { return ProcessResult.OK; } boolean isMbox = false; boolean isEMLFile = false; try { byte[] t = new byte[64]; if (abstractFile.getSize() > 64) { int byteRead = abstractFile.read(t, 0, 64); if (byteRead > 0) { isMbox = MboxParser.isValidMimeTypeMbox(t); isEMLFile = EMLParser.isEMLFile(abstractFile, t); } } } catch (TskException ex) { logger.log(Level.WARNING, null, ex); } try { communicationArtifactsHelper = new CommunicationArtifactsHelper(currentCase.getSleuthkitCase(), EmailParserModuleFactory.getModuleName(), abstractFile, Account.Type.EMAIL); } catch (TskCoreException ex) { <START> logger.log(Level.SEVERE, String.format("Failed to create CommunicationArtifactsHelper for file %s", abstractFile.getName()), ex); <END> return ProcessResult.ERROR; } if (isMbox) { return processMBox(abstractFile); } if (isEMLFile) { return processEMLFile(abstractFile); } if (PstParser.isPstFile(abstractFile)) { return processPst(abstractFile); } if (VcardParser.isVcardFile(abstractFile)) { return processVcard(abstractFile); } return ProcessResult.OK; }</code><technical_language>In general, I log object ID, names, identify files is ambiguity</technical_language>

Target:
public ProcessResult process(AbstractFile abstractFile) { blackboard = currentCase.getSleuthkitCase().getBlackboard(); if (abstractFile.getKnown().equals(TskData.FileKnown.KNOWN)) { return ProcessResult.OK; } if ((abstractFile.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS)) || (abstractFile.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.SLACK))) { return ProcessResult.OK; } if ((abstractFile.isFile() == false)) { return ProcessResult.OK; } boolean isMbox = false; boolean isEMLFile = false; try { byte[] t = new byte[64]; if (abstractFile.getSize() > 64) { int byteRead = abstractFile.read(t, 0, 64); if (byteRead > 0) { isMbox = MboxParser.isValidMimeTypeMbox(t); isEMLFile = EMLParser.isEMLFile(abstractFile, t); } } } catch (TskException ex) { logger.log(Level.WARNING, null, ex); } try { communicationArtifactsHelper = new CommunicationArtifactsHelper(currentCase.getSleuthkitCase(), EmailParserModuleFactory.getModuleName(), abstractFile, Account.Type.EMAIL); } catch (TskCoreException ex) { logger.log(Level.SEVERE, String.format("Failed to create CommunicationArtifactsHelper for file with object id = %d", abstractFile.getId()), ex); return ProcessResult.ERROR; } if (isMbox) { return processMBox(abstractFile); } if (isEMLFile) { return processEMLFile(abstractFile); } if (PstParser.isPstFile(abstractFile)) { return processPst(abstractFile); } if (VcardParser.isVcardFile(abstractFile)) { return processVcard(abstractFile); } return ProcessResult.OK; }
Source:
<code>private boolean canPredPushdown(ExprNodeDesc expr, List<ExprNodeDesc> groupByKeys, FastBitSet[] bitSets, int groupingSetPosition) { List<ExprNodeDesc> columns = new ArrayList<ExprNodeDesc>(); extractCols(expr, columns); for (ExprNodeDesc col : columns) { int index = groupByKeys.indexOf(col); assert index >= 0; for (FastBitSet bitset : bitSets) { int keyPos = bitset.nextClearBit(0); <START> for (; keyPos < groupingSetPosition && keyPos != index; <END> keyPos = bitset.nextClearBit(keyPos + 1)); if (keyPos != index) { return false; } } } return true; }</code><technical_language>Please a while</technical_language>

Target:
private boolean canPredPushdown(ExprNodeDesc expr, List<ExprNodeDesc> groupByKeys, FastBitSet[] bitSets, int groupingSetPosition) { List<ExprNodeDesc> columns = new ArrayList<ExprNodeDesc>(); extractCols(expr, columns); for (ExprNodeDesc col : columns) { int index = groupByKeys.indexOf(col); assert index >= 0; for (FastBitSet bitset : bitSets) { int keyPos = bitset.nextClearBit(0); while (keyPos < groupingSetPosition && keyPos != index) { keyPos = bitset.nextClearBit(keyPos + 1); } if (keyPos != index) { return false; } } } return true; }
Source:
<code>public String createAppointment(Appointment appointment) { String id = null; try { login(); URL postUrl = new URL("<LINK_0>" + googleUser + "/private/full"); CalendarEventEntry myEntry = AppointmentConverter.convertAppointmentToCalendarEventEntry(appointment); CalendarEventEntry insertedEntry = service.insert(postUrl, myEntry); id = insertedEntry.getEditLink().getHref(); log.info("Successfully created appointment " + id); appointment.setId(id); } catch (MalformedURLException e) { <START> log.error("unknown type of URL"); <END> } catch (IOException e) { log.error("unable to connect to the google server"); } catch (ServiceException e) { log.error("unable to insert the appointment"); } finally { this.state = AliveState.DISCONNECTED; } return id; }</code><technical_language>do swallow exceptions that. consider throwing Exception (DomainMethodExecutionException). In case _always_ preserve stacktrace meaning: throw Exception including exception in constructor, include exception in log-statement (log.error("bla", exception));</technical_language>

Target:
public String createAppointment(Appointment appointment) { String id = null; try { login(); URL postUrl = new URL("<LINK_0>" + googleUser + "/private/full"); CalendarEventEntry myEntry = AppointmentConverter.convertAppointmentToCalendarEventEntry(appointment); CalendarEventEntry insertedEntry = service.insert(postUrl, myEntry); id = insertedEntry.getEditLink().getHref(); log.info("Successfully created appointment " + id); appointment.setId(id); } catch (MalformedURLException e) { throw new DomainMethodExecutionException("unknown type of URL", e); } catch (IOException e) { throw new DomainMethodExecutionException("unable to connect to the google server", e); } catch (ServiceException e) { throw new DomainMethodExecutionException("unable to insert the appointment", e); } finally { this.state = AliveState.DISCONNECTED; } return id; }
Source:
<code>private void checkPermission() throws Exception { TCSubject currentUser = DirectUtils.getTCSubjectFromSession(); if (DirectUtils.isTcStaff(currentUser) || DirectUtils.isTcOperations(currentUser) || DirectUtils.isTCPlatformSpecialist(currentUser)) { return; } List<ContestCopilotDTO> copilots = DataProvider.getCopilotsForDirectProject( getFormData().getProjectId()); for (ContestCopilotDTO copilot : copilots) { if (copilot.getUserId() == currentUser.getUserId()) { return; } } <START> throw new Exception("You don't have permission to access"); <END> }</code><technical_language>Do need add work owner well</technical_language>

Target:
private void checkPermission() throws Exception { if (!AuthorizationProvider.isUserGrantedToAccessWorkManager( DirectUtils.getTCSubjectFromSession(), getFormData().getProjectId())) { String errorMessage = "You don't have permission to access the work manager page."; DirectUtils.setErrorMessageInErrorPage(errorMessage); throw new Exception(errorMessage); } }
Source:
<code>public Response end(Action action) { return doAction(VdcActionType.EndExternalStep, <START> new EndExternalStepParameters(guid, action.isSucceeded(), action.isForce()), action); <END> }</code><technical_language>combination of succedded force is clear me, discuss this; I this API change</technical_language>

Target:
public Response end(Action action) { return doAction(VdcActionType.EndExternalStep, new EndExternalStepParameters(guid, action.isSucceeded()), action); }
Source:
<code>void deleteAllById(@Autowired PersonRepository repository) { <START> PersonWithAllConstructor person3 = new PersonWithAllConstructor(id1, TEST_PERSON1_NAME, <END> TEST_PERSON1_FIRST_NAME, TEST_PERSON_SAMEVALUE,true, 1L, TEST_PERSON1_BORN_ON, "something", Arrays.asList("a", "b"), NEO4J_HQ, Instant.now()); repository.deleteAllById(Arrays.asList(person1.getId(), person3.getId())); assertThat(repository.findAll()).extracting(PersonWithAllConstructor::getId).containsExactly(id2); }</code><technical_language>purpose of instance? id person 1 retrieve in delete below</technical_language>

Target:
void deleteAllById(@Autowired PersonRepository repository) { PersonWithAllConstructor person3 = new PersonWithAllConstructor(id1, TEST_PERSON1_NAME, TEST_PERSON1_FIRST_NAME, TEST_PERSON_SAMEVALUE, true, 1L, TEST_PERSON1_BORN_ON, "something", Arrays.asList("a", "b"), NEO4J_HQ, Instant.now()); repository.save(person3); repository.deleteAllById(Arrays.asList(person1.getId(), person3.getId())); assertThat(repository.findAll()).extracting(PersonWithAllConstructor::getId).containsExactly(id2); }
Source:
<code>AbstractStreamingCommitterOperator<CommT, CommT> createStreamingCommitterOperator() { return new StreamingCommitterOperator<>( sink.createCommitter() .orElseThrow(() -> new IllegalArgumentException( "Could not create committer from the sink")), sink.getCommittableSerializer() <START> .orElseThrow(() -> new IllegalArgumentException( <END> "Could not get committable serializer from the sink"))); }</code><technical_language>in other factory</technical_language>

Target:
AbstractStreamingCommitterOperator<CommT, CommT> createStreamingCommitterOperator() { return new StreamingCommitterOperator<>( sink.createCommitter() .orElseThrow(() -> new IllegalStateException( "Could not create committer from the sink")), sink.getCommittableSerializer() .orElseThrow(() -> new IllegalStateException( "Could not get committable serializer from the sink"))); }
Source:
<code><START> private static boolean onlyRaisesNotImplementedError(AstNode funcDef) { <END> AstNode suite = funcDef.getFirstChild(PythonGrammar.SUITE); List<AstNode> statements = suite.getChildren(PythonGrammar.STATEMENT); if (statements.isEmpty()) { AstNode statementList = suite.getFirstChild(); if (isRaise(statementList)) { AstNode testStatement = statementList.getFirstDescendant(PythonGrammar.TEST); if ("NotImplementedError".equals(testStatement.getToken().getValue())) { return true; } } } else { if (statements.size() <= 2) { if (statements.size() == 2 && !isDocstring(statements.get(0))) { return false; } AstNode statementList = statements.get(statements.size() - 1).getFirstChild(PythonGrammar.STMT_LIST); if (statementList != null && isRaise(statementList)) { AstNode testStatement = statementList.getFirstDescendant(PythonGrammar.TEST); if ("NotImplementedError".equals(testStatement.getToken().getValue())) { return true; } } } } return false; }</code><technical_language>![MAJOR](<LINK_0> Cyclomatic Complexity of this method "onlyRaisesNotImplementedError" is 11 is greater 10 authorized. [![rule](<LINK_2>](<LINK_1></technical_language>

Target:
private static boolean onlyRaisesNotImplementedError(AstNode funcDef) { AstNode suite = funcDef.getFirstChild(PythonGrammar.SUITE); List<AstNode> statements = suite.getChildren(PythonGrammar.STATEMENT); if (statements.isEmpty()) { AstNode statementList = suite.getFirstChild(); if (raisesNotImplementedError(statementList)) { return true; } } else { if (statements.size() <= 2) { if (statements.size() == 2 && !isDocstring(statements.get(0))) { return false; } AstNode statementList = statements.get(statements.size() - 1).getFirstChild(PythonGrammar.STMT_LIST); if (statementList != null && raisesNotImplementedError(statementList)) { return true; } } } return false; }
Source:
<code>private IntIterator newRLEIterator(int maxLevel, BytesInput bytes) { try { if (maxLevel == 0) { return new NullIntIterator(); } return new RLEIntIterator( new RunLengthBitPackingHybridDecoder( BytesUtils.getWidthFromMaxInt(maxLevel), <START> new ByteBufferInputStream(bytes.toByteBuffer()))); <END> } catch (IOException e) { throw new ParquetDecodingException("could not read levels in page for col " + path, e); } }</code><technical_language>create bytes.toInputStream() this a default</technical_language>

Target:
private IntIterator newRLEIterator(int maxLevel, BytesInput bytes) { try { if (maxLevel == 0) { return new NullIntIterator(); } return new RLEIntIterator( new RunLengthBitPackingHybridDecoder( BytesUtils.getWidthFromMaxInt(maxLevel), bytes.toInputStream())); } catch (IOException e) { throw new ParquetDecodingException("could not read levels in page for col " + path, e); } }
Source:
<code>public int hashCode() { <START> final int prime = 31; <END> int result = 1; result = prime * result + ((type == null) ? 0 : type.hashCode()); result = prime * result + ((value == null) ? 0 : value.hashCode()); return result; }</code><technical_language>guava for equal hashcode... reduces code a lot</technical_language>

Target:
public int hashCode() { return Objects.hashCode(type, value); }
Source:
<code>public byte[] toBytes() { ByteBuffer idBuf = ByteBuffer.allocate(sizeInBytes()); idBuf.putShort(version); switch (version) { case BLOB_ID_V1: break; case BLOB_ID_V2: case BLOB_ID_V4: byte flag = (byte) (type.ordinal() & BLOB_ID_TYPE_MASK); flag |= isEncrypted ? IS_ENCRYPTED_MASK : 0; idBuf.put(flag); idBuf.put(datacenterId); idBuf.putShort(accountId); idBuf.putShort(containerId); break; <START> case BLOB_ID_V3: <END> flag = (byte) (type.ordinal() & BLOB_ID_TYPE_MASK); idBuf.put(flag); idBuf.put(datacenterId); idBuf.putShort(accountId); idBuf.putShort(containerId); break; default: throw new IllegalArgumentException("blobId version=" + version + " not supported"); } idBuf.put(partitionId.getBytes()); idBuf.putInt(uuid.getBytes().length); idBuf.put(uuid.getBytes()); return idBuf.array(); }</code><technical_language>minor: switch case for versions in order</technical_language>

Target:
public byte[] toBytes() { ByteBuffer idBuf = ByteBuffer.allocate(sizeInBytes()); idBuf.putShort(version); byte flag; switch (version) { case BLOB_ID_V1: break; case BLOB_ID_V2: case BLOB_ID_V3: flag = (byte) (type.ordinal() & BLOB_ID_TYPE_MASK); idBuf.put(flag); idBuf.put(datacenterId); idBuf.putShort(accountId); idBuf.putShort(containerId); break; case BLOB_ID_V4: flag = (byte) (type.ordinal() & BLOB_ID_TYPE_MASK); flag |= isEncrypted ? IS_ENCRYPTED_MASK : 0; idBuf.put(flag); idBuf.put(datacenterId); idBuf.putShort(accountId); idBuf.putShort(containerId); break; default: throw new IllegalArgumentException("blobId version=" + version + " not supported"); } idBuf.put(partitionId.getBytes()); idBuf.putInt(uuid.getBytes().length); idBuf.put(uuid.getBytes()); return idBuf.array(); }
Source:
<code>private boolean isHealthcheckOverdue(SingularityTask task) { <START> final long healthcheckDuration = taskManager.getLastHealthcheck(task.getTaskId()).get().getDurationMillis().or(0L); <END> final boolean isOverdue = healthcheckDuration > getKillAfterHealthcheckRunningForMillis(); if (isOverdue) { LOG.debug("Task healthcheck is overdue (duration: {}), allowed limit {}", task.getTaskId(), JavaUtils.durationFromMillis(healthcheckDuration), JavaUtils.durationFromMillis(getKillAfterHealthcheckRunningForMillis())); } return isOverdue; }</code><technical_language>able time task entered running state</technical_language>

Target:
private boolean isHealthcheckOverdue(SingularityTask task) { final long healthcheckDuration = System.currentTimeMillis() - getTaskRunningStartTime(task.getTaskId()); final boolean isOverdue = healthcheckDuration > getKillAfterHealthcheckRunningForMillis(); if (isOverdue) { LOG.debug("Task healthcheck is overdue (duration: {}), allowed limit {}", task.getTaskId(), JavaUtils.durationFromMillis(healthcheckDuration), JavaUtils.durationFromMillis(getKillAfterHealthcheckRunningForMillis())); } return isOverdue; }
Source:
<code><START> public void testChangeMetaReplicaCount() throws Exception { <END> Admin admin = TEST_UTIL.getAdmin(); try (RegionLocator locator = TEST_UTIL.getConnection().getRegionLocator(TableName.META_TABLE_NAME)) { assertEquals(1, locator.getAllRegionLocations().size()); HBaseTestingUtility.setReplicas(admin, TableName.META_TABLE_NAME, 3); TEST_UTIL.waitFor(30000, () -> locator.getAllRegionLocations().size() == 3); HBaseTestingUtility.setReplicas(admin, TableName.META_TABLE_NAME, 2); TEST_UTIL.waitFor(30000, () -> locator.getAllRegionLocations().size() == 2); } }</code><technical_language>adding more logics verify ClientZKSyncer is working meta replica changes, especially reducing multiple single replica</technical_language>

Target:
public void testChangeMetaReplicaCount() throws Exception { Admin admin = TEST_UTIL.getAdmin(); try (RegionLocator locator = TEST_UTIL.getConnection().getRegionLocator(TableName.META_TABLE_NAME)) { assertEquals(1, locator.getAllRegionLocations().size()); HBaseTestingUtility.setReplicas(admin, TableName.META_TABLE_NAME, 3); TEST_UTIL.waitFor(30000, () -> locator.getAllRegionLocations().size() == 3); HBaseTestingUtility.setReplicas(admin, TableName.META_TABLE_NAME, 2); TEST_UTIL.waitFor(30000, () -> locator.getAllRegionLocations().size() == 2); HBaseTestingUtility.setReplicas(admin, TableName.META_TABLE_NAME, 1); TEST_UTIL.waitFor(30000, () -> locator.getAllRegionLocations().size() == 1); } }
Source:
<code>public CategoryPill.Data execute(final CreateCategoryContext context) { JSONObject jsonObject = new JSONObject(ImmutableMap.builder() .put("name", context.getCategoryName()) .put("parentId", PARENT_ID) .put("siteId", context.getSiteId()) .build()); String response = null; try { response = remoteOperation.execute(buildUrl(context), jsonObject); } catch(RemoteException e) { PageObjectLogging.logError("error: ", e); } <START> DocumentContext json = JsonPath.parse(response); <END> CategoryPill.Data data = new CategoryPill.Data(json.read("$.id"), json.read("$.name")); data.setDisplayOrder(json.read("$.displayOrder")); return data; }</code><technical_language>If remoteOperation.execute fails get a null pointer exception here. I suggest moving response evaluation another method re-throw RemoteException</technical_language>

Target:
public CategoryPill.Data execute(final CreateCategoryContext context) { JSONObject jsonObject = new JSONObject(ImmutableMap.builder() .put("name", context.getCategoryName()) .put("parentId", PARENT_ID) .put("siteId", context.getSiteId()) .build()); String response; try { response = remoteOperation.execute(buildUrl(context), jsonObject); } catch(RemoteException e) { PageObjectLogging.logError("error: ", e); throw new CategoryNotCreated("Could not create a new category.", e); } DocumentContext json = JsonPath.parse(response); CategoryPill.Data data = new CategoryPill.Data(json.read("$.id"), json.read("$.name")); data.setDisplayOrder(json.read("$.displayOrder")); return data; }
Source:
<code>public static void deliverReport(String releaseStage, String payload) { if (releaseStage == null || releaseStage.length() == 0 || getClient().getConfig().shouldNotifyForReleaseStage(releaseStage)) { getClient().getErrorStore().enqueueContentForDelivery(payload); <START> getClient().getErrorStore().flushAsync(); <END> } }</code><technical_language>This is paranoia, good cache getClient() in a local variable in case Bugsnag.init() is called multiple times. calls theoretically invoked clients</technical_language>

Target:
public static void deliverReport(String releaseStage, String payload) { Client client = getClient(); if (releaseStage == null || releaseStage.length() == 0 || client.getConfig().shouldNotifyForReleaseStage(releaseStage)) { client.getErrorStore().enqueueContentForDelivery(payload); client.getErrorStore().flushAsync(); } }
Source:
<code>public static List<SleepPeriod> getSleepPeriodQueue(final DateTime targetDate, final DateTime currentTimeLocal){ final List<SleepPeriod> sleepPeriods = new ArrayList<>(); if (currentTimeLocal.isAfter(targetDate.plusDays(1).withTimeAtStartOfDay().plusHours(3).getMillis())){ return createAllSleepPeriods(targetDate); } <START> if (currentTimeLocal.isAfter(targetDate.withTimeAtStartOfDay().plusHours(19).getMillis())){ <END> sleepPeriods.add(SleepPeriod.morning(targetDate)); sleepPeriods.add(SleepPeriod.afternoon(targetDate)); return sleepPeriods; } if (currentTimeLocal.isAfter(targetDate.withTimeAtStartOfDay().plusHours(7).getMillis())){ sleepPeriods.add(SleepPeriod.morning(targetDate)); return sleepPeriods; } return sleepPeriods; }</code><technical_language>extract 19 a constant</technical_language>

Target:
public static List<SleepPeriod> getSleepPeriodQueue(final DateTime targetDate, final DateTime currentTimeLocal){ final List<SleepPeriod> sleepPeriods = new ArrayList<>(); if (currentTimeLocal.isAfter(targetDate.withTimeAtStartOfDay().plusHours(FULLDAY_ROLLOVER).getMillis())){ return createAllSleepPeriods(targetDate); } if (currentTimeLocal.isAfter(targetDate.withTimeAtStartOfDay().plusHours(AFTERNOON_ROLLOVER).getMillis())){ sleepPeriods.add(SleepPeriod.morning(targetDate)); sleepPeriods.add(SleepPeriod.afternoon(targetDate)); return sleepPeriods; } if (currentTimeLocal.isAfter(targetDate.withTimeAtStartOfDay().plusHours(MORNING_ROLLOVER).getMillis())){ sleepPeriods.add(SleepPeriod.morning(targetDate)); return sleepPeriods; } return sleepPeriods; }
Source:
<code>public AuthorizationRest findByObjectAndFeature(@Parameter(value = "uri", required = true) String uri, @Parameter(value = "eperson") UUID epersonUuid, @Parameter(value = "feature", required = true) String featureName, Pageable pageable) throws AuthorizeException, SQLException { Context context = obtainContext(); BaseObjectRest obj = utils.getBaseObjectRestFromUri(context, uri); if (obj == null) { return null; } EPerson currUser = context.getCurrentUser(); EPerson user = getUserFromRequestParameter(context, epersonUuid); context.setCurrentUser(user); AuthorizationFeature feature = authorizationFeatureService.find(featureName); AuthorizationRest authorizationRest = null; <START> if (authorizationFeatureService.isAuthorized(context, feature, obj)) { <END> Authorization authz = new Authorization(); authz.setEperson(user); authz.setFeature(feature); authz.setObject(obj); authorizationRest = converter.toRest(authz, utils.obtainProjection()); } context.setCurrentUser(currUser); return authorizationRest; }</code><technical_language>Similar above, check impact of special groups</technical_language>

Target:
public AuthorizationRest findByObjectAndFeature(@Parameter(value = "uri", required = true) String uri, @Parameter(value = "eperson") UUID epersonUuid, @Parameter(value = "feature", required = true) String featureName, Pageable pageable) throws AuthorizeException, SQLException { Context context = obtainContext(); BaseObjectRest obj = utils.getBaseObjectRestFromUri(context, uri); if (obj == null) { return null; } EPerson currUser = context.getCurrentUser(); EPerson user = getUserFromRequestParameter(context, epersonUuid); if (currUser != user) { context.switchContextUser(user); } AuthorizationFeature feature = authorizationFeatureService.find(featureName); AuthorizationRest authorizationRest = null; if (authorizationFeatureService.isAuthorized(context, feature, obj)) { Authorization authz = new Authorization(); authz.setEperson(user); authz.setFeature(feature); authz.setObject(obj); authorizationRest = converter.toRest(authz, utils.obtainProjection()); } if (currUser != user) { context.restoreContextUser(); } return authorizationRest; }
Source:
<code>public static Polygon unifyWindingOrderForPolyGon(Polygon poly, boolean counterClockWise) { LinearRing shell = unifyWindingOrderForLinearRing((LinearRing) poly.getExteriorRing(), counterClockWise); LinearRing holes[] = new LinearRing[poly.getNumInteriorRing()]; for (int i = 0; i < poly.getNumInteriorRing(); i++) { holes[i] = unifyWindingOrderForLinearRing((LinearRing) poly.getInteriorRingN(i), !counterClockWise); } Polygon tempPoly = factory.createPolygon(shell, <START> poly.getNumInteriorRing() > 0 ? holes : null); <END> return tempPoly; }</code><technical_language>If do check poly.getNumInteriorRing() > 0 anyway, do earlier if condition is met create array in place</technical_language>

Target:
public static Polygon unifyWindingOrderForPolyGon(Polygon poly, boolean counterClockWise) { LinearRing shell = unifyWindingOrderForLinearRing((LinearRing) poly.getExteriorRing(), counterClockWise); Polygon revPoly; if (poly.getNumInteriorRing() > 0) { LinearRing holes[] = new LinearRing[poly.getNumInteriorRing()]; for (int i = 0; i < poly.getNumInteriorRing(); i++) { holes[i] = unifyWindingOrderForLinearRing((LinearRing) poly.getInteriorRingN(i), !counterClockWise); } revPoly = factory.createPolygon(shell, holes); } else revPoly = factory.createPolygon(shell); return revPoly; }
Source:
<code>public static boolean fixAppDataPermissions(Context context) { if (!Shell.SU.available()) { Log.e(TAG, "Root is not available. Cannot fix permissions."); return false; } String packageName; ApplicationInfo appInfo; try { packageName = context.getPackageName(); appInfo = context.getPackageManager().getApplicationInfo(packageName, 0); } catch (NameNotFoundException e) { Log.w(TAG, "Error getting current package name", e); return false; } Log.d(TAG, "Uid of '" + packageName + "' is " + appInfo.uid); String dir = context.getFilesDir().getAbsolutePath(); String cmd = "chown -R " + appInfo.uid + ":" + appInfo.uid + " " + dir + "; "; cmd += "restorecon -R " + dir + "\n"; Log.d(TAG, "Running: '" + cmd); int exitCode = runShellCommand(cmd, true); if (exitCode == 0) { Log.i(TAG, "Fixed app data permissions on '" + dir + "'."); } else { Log.w(TAG, "Failed to fix app data permissions on '" + dir + "'. Result: " + Integer.toString(exitCode)); } <START> return (exitCode == 0); <END> }</code><technical_language>need for braces</technical_language>

Target:
public static boolean fixAppDataPermissions(Context context) { if (!Shell.SU.available()) { Log.e(TAG, "Root is not available. Cannot fix permissions."); return false; } String packageName; ApplicationInfo appInfo; try { packageName = context.getPackageName(); appInfo = context.getPackageManager().getApplicationInfo(packageName, 0); } catch (NameNotFoundException e) { Log.w(TAG, "Error getting current package name", e); return false; } Log.d(TAG, "Uid of '" + packageName + "' is " + appInfo.uid); String dir = context.getFilesDir().getAbsolutePath(); String cmd = "chown -R " + appInfo.uid + ":" + appInfo.uid + " " + dir + "; "; cmd += "restorecon -R " + dir + "\n"; Log.d(TAG, "Running: '" + cmd); int exitCode = runShellCommand(cmd, true); if (exitCode == 0) { Log.i(TAG, "Fixed app data permissions on '" + dir + "'."); } else { Log.w(TAG, "Failed to fix app data permissions on '" + dir + "'. Result: " + Integer.toString(exitCode)); } return exitCode == 0; }
Source:
<code>public DataTransactionResult remove(DataHolder dataHolder) { <START> return DataTransactionBuilder.builder().result(DataTransactionResult.Type.FAILURE).build(); <END> }</code><technical_language>here. Removing a PassengerData Entity unmount passenger</technical_language>

Target:
public DataTransactionResult remove(DataHolder dataHolder) { if (supports(dataHolder)) { net.minecraft.entity.Entity entity = ((net.minecraft.entity.Entity) dataHolder); if (entity.isRiding()) { entity.mountEntity(null); return DataTransactionBuilder.builder().result(DataTransactionResult.Type.SUCCESS).build(); } else { return DataTransactionBuilder.builder().result(DataTransactionResult.Type.FAILURE).build(); } } else { return DataTransactionBuilder.builder().result(DataTransactionResult.Type.FAILURE).build(); } }
Source:
<code>public void clean(Path path) { String[] command = {"make", "clean"}; if (run(command, path).isPresent()) { log.info("Cleaned project"); } else { log.warn("Cleaning project was not successful"); <START> <END> } }</code><technical_language>Nit: Extra line</technical_language>

Target:
public void clean(Path path) { String[] command = {"make", "clean"}; try { ProcessResult result = run(command, path); if (result.statusCode != 0) { log.error("Cleaning project was not successful", result.errorOutput); } log.info("Cleaned project"); } catch (Exception e) { log.error("Cleaning project was not successful", e); } }
Source:
<code>public static List<CallExpression> extractSupportedSpatialComparisons(RowExpression filterExpression, FunctionManager functionManager) { return LogicalRowExpressions.extractConjuncts(filterExpression).stream() .filter(CallExpression.class::isInstance) .map(CallExpression.class::cast) <START> .filter(call -> functionManager.getFunctionMetadata(call.getFunctionHandle()).getOperatorType().map(OperatorType::isComparisonOperator).orElse(false)) <END> .filter(call -> isSupportedSpatialComparison(call, functionManager)) .collect(toImmutableList()); }</code><technical_language>FunctionResolution instead</technical_language>

Target:
public static List<CallExpression> extractSupportedSpatialComparisons(RowExpression filterExpression, FunctionManager functionManager) { return LogicalRowExpressions.extractConjuncts(filterExpression).stream() .filter(CallExpression.class::isInstance) .map(CallExpression.class::cast) .filter(call -> new FunctionResolution(functionManager).isComparisonFunction(call.getFunctionHandle())) .filter(call -> isSupportedSpatialComparison(call, functionManager)) .collect(toImmutableList()); }
Source:
<code>public void testNegateAllExceptJavaInSrc() throws IOException { writeIgnoreFile(".gitignore", "/*", "!/src/"); writeTrashFile("nothere.o", ""); writeIgnoreFile("src/.gitignore", "*", "!*.java"); writeTrashFile("src/keep.java", ""); <START> writeTrashFile("src/nothere.o", ""); <END> writeTrashFile("src/a/nothere.o", ""); beginWalk(); assertEntry(F, ignored, ".gitignore"); assertEntry(F, ignored, "nothere.o"); assertEntry(D, false, "src"); assertEntry(F, ignored, "src/.gitignore"); assertEntry(D, ignored, "src/a"); assertEntry(F, ignored, "src/a/nothere.o"); assertEntry(F, tracked, "src/keep.java"); }</code><technical_language>This included in assertEntry below</technical_language>

Target:
public void testNegateAllExceptJavaInSrc() throws IOException { writeIgnoreFile(".gitignore", "/*", "!/src/"); writeTrashFile("nothere.o", ""); writeIgnoreFile("src/.gitignore", "*", "!*.java"); writeTrashFile("src/keep.java", ""); writeTrashFile("src/nothere.o", ""); writeTrashFile("src/a/nothere.o", ""); beginWalk(); assertEntry(F, ignored, ".gitignore"); assertEntry(F, ignored, "nothere.o"); assertEntry(D, tracked, "src"); assertEntry(F, ignored, "src/.gitignore"); assertEntry(D, ignored, "src/a"); assertEntry(F, ignored, "src/a/nothere.o"); assertEntry(F, tracked, "src/keep.java"); assertEntry(F, ignored, "src/nothere.o"); endWalk(); }
Source:
<code>public int compareTo(InformationLoss<?> other) { <START> if (!other.getClass().equals(this.getClass())) { <END> throw new IllegalArgumentException("Incompatible class (" + other.getClass().getSimpleName() + ")"); } BigFraction otherValue = ((ILScore)other).getValue(); return value.compareTo(otherValue) * -1; }</code><technical_language>Is this needed? this removed for efficiency reasons (but I this method is used...)</technical_language>

Target:
public int compareTo(InformationLoss<?> other) { BigFraction otherValue = ((ILScore)other).getValue(); return value.compareTo(otherValue) * -1; }
Source:
<code>private String completeErrorMessage(String errorMessage) { <START> String completeErrorMessage = "\n" + <END> "\nThe following OpenGL versions/extensions are required but are not supported by your GPU driver:\n" + "\n" + errorMessage + "\n" + "GPU Information:\n" + "\n"; if (GLContext.getCapabilities().OpenGL11) { completeErrorMessage = completeErrorMessage + " Vendor: " + GL11.glGetString(GL11.GL_VENDOR) + "\n" + " Model: " + GL11.glGetString(GL11.GL_RENDERER) + "\n" + " Drivers: " + GL11.glGetString(GL11.GL_VERSION) + "\n"; } else { String adapterName = Display.getAdapter(); if (adapterName == null) { adapterName = "unknown"; } String driverVersion = Display.getVersion(); if (driverVersion == null) { driverVersion = "unknown"; } completeErrorMessage = completeErrorMessage + " GPU in use: " + adapterName + "\n" + " GPU Driver Version: " + driverVersion + "\n"; } completeErrorMessage += "\n"; completeErrorMessage += "Try updating the drivers to the latest version available.\n" + "If that fails you might need a different GPU. Sorry!\n"; return completeErrorMessage; }</code><technical_language>I remove newline chars. text, odd in GUI dialog</technical_language>

Target:
private String completeErrorMessage(String errorMessage) { String completeErrorMessage = "\n" + "\nThe following OpenGL versions/extensions are required but are not supported by your GPU driver:\n" + "\n" + errorMessage + "\n" + "GPU Information:\n" + "\n" + " Vendor: " + GL11.glGetString(GL11.GL_VENDOR) + "\n" + " Model: " + GL11.glGetString(GL11.GL_RENDERER) + "\n" + " Driver: " + GL11.glGetString(GL11.GL_VERSION) + "\n" + "\n" + "Try updating the driver to the latest version available.\n" + "If that fails you might need a different GPU. Sorry!\n"; return completeErrorMessage; }
Source:
<code>private void handleNoSuccess(final DataObjectAttrExecutor dataObjectAttrExecutor) throws DataObjectAttrExecutionCancellationException { this.errString += dataObjectAttrExecutor.createRequestAndResultCodeInfo(); this.containsError = true; if (this.stopOnNoSuccess) { <START> throw new DataObjectAttrExecutionCancellationException(dataObjectAttrExecutor.getName() <END> + " was unsuccesfull. Stopping execution after element: " + this.dataObjectAttrExecutorList.indexOf(dataObjectAttrExecutor) + " (total elements: " + this.dataObjectAttrExecutorList.size() + ")"); } }</code><technical_language>errString in exception</technical_language>

Target:
private void handleNoSuccess(final DataObjectAttrExecutor dataObjectAttrExecutor) throws ProtocolAdapterException { this.errString += dataObjectAttrExecutor.createRequestAndResultCodeInfo(); this.containsError = true; if (this.stopOnNoSuccess) { LOGGER.error(this.executor + REQUESTS_FAILED_FOR, this.errString); throw new ProtocolAdapterException(this.errString + ". Stopping execution after element: " + this.dataObjectAttrExecutorList.indexOf(dataObjectAttrExecutor) + " (total elements: " + this.dataObjectAttrExecutorList.size() + ")"); } }
Source:
<code>public void visitMethod(MethodTree tree) { <START> if (tree == writeObjectMethodTree || moreThanSingleLock) { <END> return; } if (hasModifier(tree.modifiers(), SYNCHRONIZED)) { moreThanSingleLock = true; } super.visitMethod(tree); }</code><technical_language>![MAJOR](<LINK_1> Change this comparison equals method. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public void visitMethod(MethodTree tree) { if (tree == writeObjectMethodTree || moreThanSingleLock) { return; } if (hasModifier(tree.modifiers(), SYNCHRONIZED)) { moreThanSingleLock = true; return; } super.visitMethod(tree); }
Source:
<code>public PdfActionUrlObject(FormLayout formLayout, String crfOid, String instance, String ecid, String redirect, boolean markComplete, String studyOid, List<FormLayoutMedia> mediaList, String goTo, String flavor, Role role, Study parentStudy, Study site, StudyEvent studyEvent, String mode, EventDefinitionCrf edc, EventCrf eventCrf, String loadWarning, boolean formLocked, String studySubjectOID, String format, String margin, String landscape) { <START> super(formLayout, crfOid, instance, ecid, redirect, markComplete, studyOid, mediaList, goTo, flavor, role, <END> parentStudy, site, studyEvent, mode, edc, eventCrf, loadWarning, formLocked, null); this.studySubjectOID = studySubjectOID; this.format = format; this.margin = margin; this.landscape = landscape; }</code><technical_language>Instead of passing null for interface, constructors in super class constructor is add a new interface additional argument? way, need change classes need this interface option avoid passing nulls</technical_language>

Target:
public PdfActionUrlObject(FormLayout formLayout, String crfOid, String instance, String ecid, String redirect, boolean markComplete, String studyOid, List<FormLayoutMedia> mediaList, String goTo, String flavor, Role role, Study parentStudy, Study site, StudyEvent studyEvent, String mode, EventDefinitionCrf edc, EventCrf eventCrf, String loadWarning, boolean formLocked, String studySubjectOID, String format, String margin, String landscape) { super(formLayout, crfOid, instance, ecid, redirect, markComplete, studyOid, mediaList, goTo, flavor, role, parentStudy, site, studyEvent, mode, edc, eventCrf, loadWarning, formLocked); this.studySubjectOID = studySubjectOID; this.format = format; this.margin = margin; this.landscape = landscape; }
Source:
<code>void ensureSize(long position) { assertNonNegativePosition(position); while (position >= this.size) { <START> addBit(false); <END> } }</code><technical_language>this inefficient? this loop easily executed 100 million times in a typical run. increase size in step</technical_language>

Target:
void ensureSize(long position) { assertNonNegativePosition(position); if (position >= this.size) { this.validHashCode = false; long newSize = position + 1; int arrayOfBitsLength = this.arrayOfBits.length; int sizeInWords = getSizeInWords(newSize); while (sizeInWords > arrayOfBitsLength) { arrayOfBitsLength = GROWTH_FACTOR * arrayOfBitsLength; } resizeArray(arrayOfBitsLength); this.size = newSize; } }
Source:
<code>public Set<Genome> getCurrentGenomeSet() { <START> return currentGenomeList; <END> }</code><technical_language>Rename currentGenomeList variable I guess</technical_language>

Target:
public Set<Genome> getCurrentGenomeSet() { return currentGenomeSet; }
Source:
<code>public AnnotationVisitor visitAnnotation(String desc, boolean visible) { Type type = getType(desc); for (Type annotationType : annotationTypes) { if (annotationType.equals(type)) { try { annotatedFields.add(selfClass().getDeclaredField(name)); break; } catch (NoSuchFieldException e) { throw new IllegalStateException("Error visiting field " + name, e); } catch (NoClassDefFoundError e) { <START> log.info("Unable to scan field '{}' of class '{}'", name, selfClass().getName(), e.getMessage()); <END> } } } return super.visitAnnotation(desc, visible); }</code><technical_language>Thanks, this allow create lazy singleton providers optional dependencies reduce transitive dependency footprint while fully participating in DI framework object management. addition of class name info message helpful for people investigating unexpected behaviors. class name useful in NoSuchFieldException message</technical_language>

Target:
public AnnotationVisitor visitAnnotation(String desc, boolean visible) { Type type = getType(desc); for (Type annotationType : annotationTypes) { if (annotationType.equals(type)) { try { annotatedFields.add(selfClass().getDeclaredField(name)); break; } catch (NoSuchFieldException e) { throw new IllegalStateException("Error visiting field " + name + " of class " + selfClass().getName(), e); } catch (NoClassDefFoundError e) { log.info("Unable to scan field '{}' of class '{}'", name, selfClass().getName(), e.getMessage()); } } } return super.visitAnnotation(desc, visible); }
Source:
<code>public Raven createRavenInstance(Dsn dsn) { Raven raven = new Raven(); raven.setConnection(createConnection(dsn)); try { Class.forName("javax.servlet.ServletRequestListener", false, this.getClass().getClassLoader()); raven.addBuilderHelper(new HttpEventBuilderHelper()); <START> raven.addBuilderHelper(new ContextBuilderHelper(raven)); <END> } catch (ClassNotFoundException e) { logger.debug("The current environment doesn't provide access to servlets," + "or provides an unsupported version."); } return raven; }</code><technical_language>I this needs in this try/catch block - this unrelated HTTP helper</technical_language>

Target:
public Raven createRavenInstance(Dsn dsn) { Raven raven = new Raven(); raven.setConnection(createConnection(dsn)); try { Class.forName("javax.servlet.ServletRequestListener", false, this.getClass().getClassLoader()); raven.addBuilderHelper(new HttpEventBuilderHelper()); } catch (ClassNotFoundException e) { logger.debug("The current environment doesn't provide access to servlets," + "or provides an unsupported version."); } raven.addBuilderHelper(new ContextBuilderHelper(raven)); return raven; }
Source:
<code>public static void checkArgument(boolean expression, String errorMessage, String... args) { if (!expression) { if (args != null && args.length > 0) { <START> String message = String.format("errorMessage", args); <END> throw new IllegalArgumentException(message); } else { throw new IllegalArgumentException(errorMessage); } } }</code><technical_language>errorMessage quoted</technical_language>

Target:
public static void checkArgument(boolean expression, String errorMessage, String... args) { if (!expression) { if (args != null && args.length > 0) { String message = String.format(errorMessage, args); throw new IllegalArgumentException(message); } else { throw new IllegalArgumentException(errorMessage); } } }
Source:
<code>private void fetch(Repository repo, URIish u) throws URISyntaxException, JGitInternalException, InvalidRemoteException, IOException { RemoteConfig config = new RemoteConfig(repo.getConfig(), origin); config.addURI(u); final String dst = Constants.R_REMOTES + config.getName(); RefSpec refSpec = new RefSpec(); refSpec = refSpec.setForceUpdate(true); refSpec = refSpec.setSourceDestination(Constants.R_HEADS + "*", dst + "/*"); config.addFetchRefSpec(refSpec); config.update(repo.getConfig()); repo.getConfig().save(); FetchCommand command = new FetchCommand(repo); command.setRemote(origin); <START> command.setRefSpecs(refSpec); <END> command.setProgressMonitor(monitor); command.call(); }</code><technical_language>This necessary inherited configuration</technical_language>

Target:
private FetchResult fetch(Repository repo, URIish u) throws URISyntaxException, JGitInternalException, InvalidRemoteException, IOException { RemoteConfig config = new RemoteConfig(repo.getConfig(), origin); config.addURI(u); final String dst = Constants.R_REMOTES + config.getName(); RefSpec refSpec = new RefSpec(); refSpec = refSpec.setForceUpdate(true); refSpec = refSpec.setSourceDestination(Constants.R_HEADS + "*", dst + "/*"); config.addFetchRefSpec(refSpec); config.update(repo.getConfig()); repo.getConfig().save(); FetchCommand command = new FetchCommand(repo); command.setRemote(origin); command.setProgressMonitor(monitor); if (credentialsProvider != null) command.setCredentialsProvider(credentialsProvider); return command.call(); }
Source:
<code>public static String toSnapshotVersion( String version ) { Validate.notBlank( version, "version can neither be null, empty nor blank" ); <START> int lastDash = version.lastIndexOf( '-' ); <END> if ( lastDash > 0 ) { int prevDash = version.lastIndexOf( '-', lastDash - 1 ); if ( prevDash > 0 ) { Matcher m = Artifact.VERSION_FILE_PATTERN.matcher( version ); if ( m.matches() ) { return m.group( 1 ) + "-" + Artifact.SNAPSHOT_VERSION; } } } return version; }</code><technical_language>a hyphen, a dash</technical_language>

Target:
public static String toSnapshotVersion( String version ) { notBlank( version, "version can neither be null, empty nor blank" ); int lastHyphen = version.lastIndexOf( '-' ); if ( lastHyphen > 0 ) { int prevHyphen = version.lastIndexOf( '-', lastHyphen - 1 ); if ( prevHyphen > 0 ) { Matcher m = Artifact.VERSION_FILE_PATTERN.matcher( version ); if ( m.matches() ) { return m.group( 1 ) + "-" + Artifact.SNAPSHOT_VERSION; } } } return version; }
Source:
<code>protected void validateApplication(ArtifactCoordinates domain, ArtifactCoordinates applicationCoordinates) throws ValidationException { Set<ArtifactCoordinates> applicationDomains = getApplicationDomains(applicationCoordinates); if (applicationDomains.size() != DOMAIN_BUNDLE_VALID_NUMBER_OF_DOMAINS || !applicationDomains.contains(domain)) { throw new ValidationException("Every application in the domain bundle must refer to the specified domain: " + domain + ". However, the application refers to the following domain(s): " <START> + applicationDomains.stream().collect(Collectors.toList())); <END> } }</code><technical_language>custom message reflect more specifically application reference domain</technical_language>

Target:
protected void validateApplication(ArtifactCoordinates domain, ArtifactCoordinates applicationCoordinates) throws ValidationException { Set<ArtifactCoordinates> applicationDomains = getApplicationDomains(applicationCoordinates); if (applicationDomains.size() != DOMAIN_BUNDLE_VALID_NUMBER_OF_DOMAINS || !applicationDomains.contains(domain)) { String message = "Every application in the domain bundle must refer to the specified domain: " + domain + ". "; if (applicationDomains.isEmpty()) { message += "However, the application has reference to no domain"; } else { message += "However, the application refers to the following domain(s): " + applicationDomains.stream().collect(Collectors.toList()); } throw new ValidationException(message); } }
Source:
<code>public String getPostId() { <START> return new String(); <END> }</code><technical_language>return "";</technical_language>

Target:
public String getPostId() { return ""; }
Source:
<code>private void validateAttributeDefs(Collection<ConfigAttribute> attributeDefs) { Set<ConfigAttribute> unsupportedAttrs = new HashSet<>(); for (ConfigAttribute attr : attributeDefs) { <START> if (!this.runAsManager.supports(attr) && this.accessDecisionManager != null <END> && !this.accessDecisionManager.supports(attr) && ((this.afterInvocationManager == null) || !this.afterInvocationManager.supports(attr))) { unsupportedAttrs.add(attr); } } if (unsupportedAttrs.size() != 0) { this.logger .trace("Did not validate configuration attributes since validateConfigurationAttributes is false"); throw new IllegalArgumentException("Unsupported configuration attributes: " + unsupportedAttrs); } else { this.logger.trace("Validated configuration attributes"); } }</code><technical_language>This test AccessDecisionManager do in AuthorizationManagerAdapter's constructor</technical_language>

Target:
private void validateAttributeDefs(Collection<ConfigAttribute> attributeDefs) { Set<ConfigAttribute> unsupportedAttrs = new HashSet<>(); for (ConfigAttribute attr : attributeDefs) { if (!this.runAsManager.supports(attr) && !this.accessDecisionManager.supports(attr) && ((this.afterInvocationManager == null) || !this.afterInvocationManager.supports(attr))) { unsupportedAttrs.add(attr); } } if (unsupportedAttrs.size() != 0) { this.logger .trace("Did not validate configuration attributes since validateConfigurationAttributes is false"); throw new IllegalArgumentException("Unsupported configuration attributes: " + unsupportedAttrs); } else { this.logger.trace("Validated configuration attributes"); } }