auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
@NonNull public static <T> PersistentResource<T> loadRecord( EntityProjection projection, String id, RequestScope requestScope ) throws InvalidObjectIdentifierException { Preconditions.checkNotNull(projection); Preconditions.checkNotNull(id); Preconditions.checkNotNull(requestScope); DataStoreTransaction tx = requestScope.getTransaction(); EntityDictionary dictionary = requestScope.getDictionary(); Class<?> loadClass = projection.getType(); Object obj = requestScope.getObjectById(loadClass, id); QueryDetail qd = null; if (obj == null) { Optional<FilterExpression> permissionFilter = getPermissionFilterExpression(loadClass, requestScope); Class<?> idType = dictionary.getIdType(loadClass); projection = projection .copyOf() .filterExpression(permissionFilter.orElse(null)) .build(); obj = tx.loadObject(projection, (Serializable) CoerceUtil.coerce(id, idType), requestScope); qd = tx.explain(projection, requestScope); queryLoggerProcessQuery(qd, requestScope); if (obj == null) { throw new InvalidObjectIdentifierException(id, dictionary.getJsonAliasFor(loadClass)); } } PersistentResource<T> resource = new PersistentResource<>( (T) obj, null, requestScope.getUUIDFor(obj), requestScope); if (!requestScope.getNewResources().contains(resource)) { resource.checkFieldAwarePermissions(ReadPermission.class); } return resource; }

Target:
@NonNull public static <T> PersistentResource<T> loadRecord( EntityProjection projection, String id, RequestScope requestScope ) throws InvalidObjectIdentifierException { Preconditions.checkNotNull(projection); Preconditions.checkNotNull(id); Preconditions.checkNotNull(requestScope); DataStoreTransaction tx = requestScope.getTransaction(); EntityDictionary dictionary = requestScope.getDictionary(); Class<?> loadClass = projection.getType(); Object obj = requestScope.getObjectById(loadClass, id); if (obj == null) { Optional<FilterExpression> permissionFilter = getPermissionFilterExpression(loadClass, requestScope); Class<?> idType = dictionary.getIdType(loadClass); projection = projection .copyOf() .filterExpression(permissionFilter.orElse(null)) .build(); obj = tx.loadObject(projection, (Serializable) CoerceUtil.coerce(id, idType), requestScope); QueryDetail qd = tx.explain(projection, requestScope); queryLoggerProcessQuery(qd, requestScope); if (obj == null) { throw new InvalidObjectIdentifierException(id, dictionary.getJsonAliasFor(loadClass)); } } PersistentResource<T> resource = new PersistentResource<>( (T) obj, null, requestScope.getUUIDFor(obj), requestScope); if (!requestScope.getNewResources().contains(resource)) { resource.checkFieldAwarePermissions(ReadPermission.class); } return resource; }
Source:
public void testPeggedToV2SerDe() throws Exception { LedgerMetadataSerDe serDe = new LedgerMetadataSerDe(); LedgerMetadata metadata = LedgerMetadataBuilder.create() .withEnsembleSize(3).withWriteQuorumSize(2).withAckQuorumSize(1) .withPassword("foobar".getBytes(UTF_8)).withDigestType(DigestType.CRC32C) .newEnsembleEntry(0L, Lists.newArrayList(new BookieSocketAddress("192.0.2.1", 3181), new BookieSocketAddress("192.0.2.2", 3181), new BookieSocketAddress("192.0.2.3", 3181))) .withMetadataFormatVersion(LedgerMetadataSerDe.METADATA_FORMAT_VERSION_2) .build(); byte[] encoded = serDe.serialize(metadata); LedgerMetadata decoded = serDe.parseConfig(encoded, Optional.empty()); Assert.assertEquals(2, decoded.getMetadataFormatVersion()); }

Target:
public void testPeggedToV2SerDe() throws Exception { LedgerMetadataSerDe serDe = new LedgerMetadataSerDe(); LedgerMetadata metadata = LedgerMetadataBuilder.create() .withEnsembleSize(3).withWriteQuorumSize(2).withAckQuorumSize(1) .withPassword("foobar".getBytes(UTF_8)).withDigestType(DigestType.CRC32C) .newEnsembleEntry(0L, Lists.newArrayList(new BookieSocketAddress("192.0.2.1", 3181), new BookieSocketAddress("192.0.2.2", 3181), new BookieSocketAddress("192.0.2.3", 3181))) .build(); byte[] encoded = serDe.serialize(metadata); LedgerMetadata decoded = serDe.parseConfig(encoded, Optional.empty()); Assert.assertEquals(2, decoded.getMetadataFormatVersion()); }
Source:
public List<ReplicationSourceInterface> getSources() { return this.sources.values().stream().filter(source -> source.isSourceActive()) .collect(Collectors.toList()); }

Target:
public List<ReplicationSourceInterface> getSources() { return new ArrayList<>(this.sources.values()); }
Source:
String parsePrimeFacesFilter(Map filters) throws IllegalArgumentException { if (Objects.nonNull(filters) && filters.entrySet().size() > 0) { if (filters.entrySet().size() > 1) { throw new IllegalArgumentException("Filter map contains to many entries (only 0 or 1 allowed)!"); } else { List<Object> filterList = new ArrayList<Object>(filters.values()); if (filterList.get(0) instanceof String) { return (String) filterList.get(0); } else { throw new IllegalArgumentException("Given filter is not a String!"); } } } else { return ""; } }

Target:
String parsePrimeFacesFilter(Map filters) { if (Objects.nonNull(filters) && filters.entrySet().size() == 1) { Map.Entry filter = (Map.Entry) filters.entrySet().stream().findAny().get(); if (filter.getValue() instanceof String) { return (String) filter.getValue(); } else { logger.warn("Given filter is not a String. Ignoring filter."); } } else if (Objects.nonNull(filters) && filters.entrySet().size() > 1) { logger.warn("Filter map contains to many entries (only 0 or 1 allowed). Ignoring filter map."); } return ""; }
Source:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } BinaryExpressionTree binaryExpression = (BinaryExpressionTree) tree; ExpressionTree leftNoParenth = ExpressionUtils.skipParentheses(binaryExpression.leftOperand()); ExpressionTree rightNoParenth = ExpressionUtils.skipParentheses(binaryExpression.rightOperand()); if (((leftNoParenth.is(Tree.Kind.EQUAL_TO) || rightNoParenth.is(Tree.Kind.EQUAL_TO)) && (expressionMatches(binaryExpression, leftNoParenth, rightNoParenth, Tree.Kind.CONDITIONAL_OR))) || ((leftNoParenth.is(Tree.Kind.NOT_EQUAL_TO) || rightNoParenth.is(Tree.Kind.NOT_EQUAL_TO)) && (expressionMatches(binaryExpression, leftNoParenth, rightNoParenth, Tree.Kind.CONDITIONAL_AND)))) { reportIssue(treeToReport(leftNoParenth, rightNoParenth), "Remove this unnecessary null check; \"instanceof\" returns false for nulls."); } }

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } BinaryExpressionTree binaryExpression = (BinaryExpressionTree) tree; ExpressionTree leftOp = ExpressionUtils.skipParentheses(binaryExpression.leftOperand()); ExpressionTree rightOp = ExpressionUtils.skipParentheses(binaryExpression.rightOperand()); if ((is(Tree.Kind.EQUAL_TO, leftOp, rightOp) && nullCheckWithInstanceOf(leftOp, rightOp, binaryExpression.kind(), Tree.Kind.CONDITIONAL_OR)) || (is(Tree.Kind.NOT_EQUAL_TO, leftOp, rightOp) && nullCheckWithInstanceOf(leftOp, rightOp, binaryExpression.kind(), Tree.Kind.CONDITIONAL_AND))) { reportIssue(treeToReport(leftOp, rightOp), "Remove this unnecessary null check; \"instanceof\" returns false for nulls."); } }
Source:
private static void initiateRequest(OSCoreCtxDB db, String uri) throws ConnectorException, IOException, OSException { OSCoreCtx ctx = db.getContext(uri); byte[] contextID1 = Bytes.createBytes(random, SEGMENT_LENGTH); OSCoreCtx newCtx = rederiveWithContextID(ctx, contextID1); newCtx.setIncludeContextId(true); newCtx.setContextRederivationPhase(ContextRederivation.PHASE.CLIENT_PHASE_1); db.addContext(uri, newCtx); String resource = "/rederive"; String URI = uri + resource; CoapClient c = new CoapClient(URI); Request r = new Request(Code.GET); r.getOptions().setOscore(Bytes.EMPTY); CoapHandler handler = new CoapHandler() { @Override public void onLoad(CoapResponse response) { LOGGER.info("Successfully received context re-derivation message"); } @Override public void onError() { LOGGER.info("Error while receiving context re-derivation message"); } }; c.advanced(handler, r); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } }

Target:
private static void initiateRequest(OSCoreCtxDB db, String uri) throws ConnectorException, IOException, OSException { OSCoreCtx ctx = db.getContext(uri); printStateLogging(ctx); byte[] contextID1 = Bytes.createBytes(random, SEGMENT_LENGTH); OSCoreCtx newCtx = rederiveWithContextID(ctx, contextID1); newCtx.setIncludeContextId(true); newCtx.setContextRederivationPhase(ContextRederivation.PHASE.CLIENT_PHASE_1); db.addContext(uri, newCtx); }
Source:
private NULL_CONSTRAINT parseNotNullConstraint() { NULL_CONSTRAINT nullConstraint = NULL_CONSTRAINT.NO_NULL_CONSTRAINT_FOUND; if ((isToken("NOT") || isToken("NULL"))) { if (readIf("NOT")) { read("NULL"); nullConstraint = NULL_CONSTRAINT.NULL_IS_NOT_ALLOWED; } else { read("NULL"); nullConstraint = NULL_CONSTRAINT.NULL_IS_ALLOWED; } if (readIf("ENABLE")) { readIf("VALIDATE"); if (readIf("NOVALIDATE")) { nullConstraint = NULL_CONSTRAINT.NULL_IS_ALLOWED; } } if (readIf("DISABLE")) { nullConstraint = NULL_CONSTRAINT.NULL_IS_ALLOWED; readIf("VALIDATE"); readIf("NOVALIDATE"); } } return nullConstraint; }

Target:
private NullConstraintType parseNotNullConstraint() { NullConstraintType nullConstraint = NullConstraintType.NO_NULL_CONSTRAINT_FOUND; if ((isToken("NOT") || isToken("NULL"))) { if (readIf("NOT")) { read("NULL"); nullConstraint = NullConstraintType.NULL_IS_NOT_ALLOWED; } else { read("NULL"); nullConstraint = NullConstraintType.NULL_IS_ALLOWED; } if (database.isDbTypeOneOf(DbTypeEnum.Oracle)) { if (readIf("ENABLE")) { readIf("VALIDATE"); if (readIf("NOVALIDATE")) { nullConstraint = NullConstraintType.NULL_IS_ALLOWED; } } if (readIf("DISABLE")) { nullConstraint = NullConstraintType.NULL_IS_ALLOWED; readIf("VALIDATE"); readIf("NOVALIDATE"); } } } return nullConstraint; }
Source:
public Version minimumCompatibilityVersion() { return V_4_1_1; }

Target:
public Version minimumCompatibilityVersion() { return V_4_1_0; }
Source:
public ExpressionProfiler() { this.expensiveExpressionThresholdMillis = EXPENSIVE_EXPRESSION_THRESHOLD_MILLIS; this.ticker = systemTicker(); }

Target:
public ExpressionProfiler() { this(systemTicker(), EXPENSIVE_EXPRESSION_THRESHOLD); }
Source:
public List<T> init(DataSource<T> source) { loader = new ListComponentLoader<T>(activity, source); return loader.loadData(); }

Target:
public void init(DataSource<T> source) { loader = new ListComponentLoader<T>(activity, source); render(loader.loadData()); }
Source:
protected boolean shouldIgnoreClass(Type type) { if (type instanceof Class) { Class<?> cls = (Class<?>) type; if (cls.getName().equals("javax.ws.rs.Response")) { return true; } } else { if (type instanceof com.fasterxml.jackson.core.type.ResolvedType) { com.fasterxml.jackson.core.type.ResolvedType rt = (com.fasterxml.jackson.core.type.ResolvedType) type; LOGGER.debug("Can't check class " + type + ", " + rt.getRawClass().getName()); if (rt.getRawClass().equals(Class.class)) { return true; } } } return false; }

Target:
protected boolean shouldIgnoreClass(Type type) { if (type instanceof Class) { Class<?> cls = (Class<?>) type; if (cls.getName().equals("javax.ws.rs.Response")) { return true; } } else { if (type instanceof com.fasterxml.jackson.core.type.ResolvedType) { com.fasterxml.jackson.core.type.ResolvedType rt = (com.fasterxml.jackson.core.type.ResolvedType) type; log.debug("Can't check class {}, {}", type, rt.getRawClass().getName()); if (rt.getRawClass().equals(Class.class)) { return true; } } } return false; }
Source:
public String get(String apiKey, String context) throws NoSuchAlgorithmException, KeyManagementException { String output = null; HttpClient client = createClient(); HttpGet request = new HttpGet("https://localhost:9092/"+context); try { request.addHeader("apikey",apiKey); HttpResponse response = client.execute(request); int responseCode = response.getStatusLine().getStatusCode(); System.out.println("Response Code: " + responseCode); System.out.println("Mocked API Content:-"); BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); output = rd.readLine(); System.out.println(output); } catch (IOException ioe) { logger.info("Error occured", ioe); } return output; }

Target:
public String get(String apiKey, String context) throws NoSuchAlgorithmException, KeyManagementException { String output = null; HttpClient client = createClient(); HttpGet request = new HttpGet("https://localhost:9092/"+context); try { request.addHeader("apikey",apiKey); HttpResponse response = client.execute(request); int responseCode = response.getStatusLine().getStatusCode(); logger.info("Response Code: " + responseCode); logger.info("Mocked API Content:-"); BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); output = rd.readLine(); logger.info(output); } catch (IOException ioe) { logger.error("Error occured", ioe); } return output; }
Source:
private static void start(CommandLine commandLine) throws Exception { ProActiveConfiguration.load(); if (!commandLine.hasOption("no-router")) { startRouter(); } String rmUrl = getRmUrl(commandLine); setCleanDatabaseProperties(commandLine); setCleanNodesourcesProperty(commandLine); rmUrl = connectToOrStartResourceManager(commandLine, rmUrl); if (commandLine.hasOption("rm-only")) { return; } SchedulerAuthenticationInterface sai = startScheduler(commandLine, rmUrl); if (!commandLine.hasOption("no-rest")) { List<String> applicationUrls = (new JettyStarter().deployWebApplications(rmUrl, sai.getHostURL())); if (applicationUrls != null && !applicationUrls.isEmpty()) { System.setProperty("rest.server.url", applicationUrls.get(0)); } } addShutdownMessageHook(); }

Target:
private static void start(CommandLine commandLine) throws Exception { ProActiveConfiguration.load(); if (!commandLine.hasOption("no-router")) { startRouter(); } String rmUrl = getRmUrl(commandLine); setCleanDatabaseProperties(commandLine); setCleanNodesourcesProperty(commandLine); rmUrl = connectToOrStartResourceManager(commandLine, rmUrl); if (commandLine.hasOption("rm-only")) { return; } SchedulerAuthenticationInterface sai = startScheduler(commandLine, rmUrl); if (!commandLine.hasOption("no-rest")) { List<String> applicationUrls = (new JettyStarter().deployWebApplications(rmUrl, sai.getHostURL())); if (applicationUrls != null) { for (String applicationUrl : applicationUrls) { if (applicationUrl.endsWith("/rest")) { if (!PASchedulerProperties.SCHEDULER_REST_URL.isSet()) { PASchedulerProperties.SCHEDULER_REST_URL.updateProperty(applicationUrl); } } } } } addShutdownMessageHook(); }
Source:
public void shouldEncodeUsernameAndPasswordWithTheCorrectFieldSeparator() throws Exception { List<String> someCorrectSeparators = Arrays.asList("-", "|", "/", "\\", "+"); String aCorrectSeparator = someCorrectSeparators.get(new Random().nextInt(someCorrectSeparators.size())); String encodedUsernamePassword = usernamePasswordAuthenticationCredentials.encode(aCorrectSeparator); assertThat(encodedUsernamePassword, notNullValue()); assertThat(encodedUsernamePassword, is("bXlVc2VybmFtZQ==~bXlQYXNzd29yZA==~")); }

Target:
public void shouldEncodeUsernameAndPasswordWithTheCorrectFieldSeparator() { List<String> someCorrectSeparators = Arrays.asList("-", "|", "/", "\\", "+"); for (String correctSeparator : someCorrectSeparators) { String encodedUsernamePassword = usernamePasswordAuthenticationCredentials.encode(correctSeparator); assertThat(String.format("Failed to encode with '%s'", correctSeparator), encodedUsernamePassword, notNullValue()); assertThat( String.format("Failed to properly encode with '%s'", correctSeparator), encodedUsernamePassword, is("bXlVc2Vy~bXlQYXNz~")); } }
Source:
public OpenFolderActionCommand(@Nonnull final String op, @Nonnull final String folderName, @Nonnull final QResyncParameter qResyncParameter) { this.op = op; this.folderName = folderName; this.qResyncParameter = qResyncParameter; this.condStore = false; }

Target:
public OpenFolderActionCommand(@Nonnull final String op, @Nonnull final String folderName, @Nonnull final QResyncParameter qResyncParameter) { this.op = op; this.folderName = folderName; this.qResyncParameter = qResyncParameter; this.isCondStoreEnabled = false; }
Source:
public void testMetacardTransformWithNullMetacard() throws Exception { BundleContext context = mock(BundleContext.class); Transform transform = mock(Transform.class); when(transform.transform(any(List.class), any(String.class), any(Map.class))) .thenThrow(IllegalArgumentException.class); CatalogFramework framework = this.createDummyCatalogFramework( provider, storageProvider, context, eventAdmin, true, transform); framework.transform((Metacard) null, "NONE", new HashMap<>()); }

Target:
public void testMetacardTransformWithNullMetacard() throws Exception { BundleContext context = mock(BundleContext.class); Transform transform = mock(Transform.class); when(transform.transform(any(List.class), any(String.class), any(Map.class))) .thenThrow(IllegalArgumentException.class); CatalogFramework framework = this.createDummyCatalogFramework( provider, storageProvider, context, eventAdmin, true, transform); framework.transform((Metacard) null, NO_TRANSFORMER_ID, new HashMap<>()); }
Source:
public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack) { if (!playerIn.capabilities.isCreativeMode) { playerIn.addExperienceLevel(-repairContainer.maximumCost); } float breakChance = net.minecraftforge.common.ForgeHooks.onAnvilRepair(playerIn, stack, repairContainer.inputSlots.getStackInSlot(0), repairContainer.inputSlots.getStackInSlot(1)); breakChance /= 2.0; repairContainer.inputSlots.setInventorySlotContents(0, null); if (repairContainer.materialCost > 0) { ItemStack itemstack = repairContainer.inputSlots.getStackInSlot(1); if (!InvTools.isEmpty(itemstack) && itemstack.stackSize > repairContainer.materialCost) { itemstack.stackSize -= repairContainer.materialCost; repairContainer.inputSlots.setInventorySlotContents(1, itemstack); } else { repairContainer.inputSlots.setInventorySlotContents(1, InvTools.emptyStack()); } } else { repairContainer.inputSlots.setInventorySlotContents(1, null); } repairContainer.maximumCost = 0; IBlockState iblockstate = worldIn.getBlockState(blockPosIn); if (!playerIn.capabilities.isCreativeMode && !worldIn.isRemote && iblockstate.getBlock() == Blocks.ANVIL && playerIn.getRNG().nextFloat() < breakChance) { int l = iblockstate.getValue(BlockAnvil.DAMAGE); ++l; if (l > 2) { worldIn.setBlockToAir(blockPosIn); worldIn.playEvent(1029, blockPosIn, 0); } else { worldIn.setBlockState(blockPosIn, iblockstate.withProperty(BlockAnvil.DAMAGE, l), 2); worldIn.playEvent(1030, blockPosIn, 0); } } else if (!worldIn.isRemote) { worldIn.playEvent(1030, blockPosIn, 0); } }

Target:
public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack) { if (!playerIn.capabilities.isCreativeMode) { playerIn.addExperienceLevel(-repairContainer.maximumCost); } float breakChance = net.minecraftforge.common.ForgeHooks.onAnvilRepair(playerIn, stack, repairContainer.inputSlots.getStackInSlot(0), repairContainer.inputSlots.getStackInSlot(1)); breakChance /= 2.0; repairContainer.inputSlots.setInventorySlotContents(0, InvTools.emptyStack()); if (repairContainer.materialCost > 0) { ItemStack itemstack = repairContainer.inputSlots.getStackInSlot(1); if (!InvTools.isEmpty(itemstack) && itemstack.stackSize > repairContainer.materialCost) { itemstack.stackSize -= repairContainer.materialCost; repairContainer.inputSlots.setInventorySlotContents(1, itemstack); } else { repairContainer.inputSlots.setInventorySlotContents(1, InvTools.emptyStack()); } } else { repairContainer.inputSlots.setInventorySlotContents(1, InvTools.emptyStack()); } repairContainer.maximumCost = 0; IBlockState iblockstate = worldIn.getBlockState(blockPosIn); if (!playerIn.capabilities.isCreativeMode && !worldIn.isRemote && iblockstate.getBlock() == Blocks.ANVIL && playerIn.getRNG().nextFloat() < breakChance) { int l = iblockstate.getValue(BlockAnvil.DAMAGE); ++l; if (l > 2) { worldIn.setBlockToAir(blockPosIn); worldIn.playEvent(1029, blockPosIn, 0); } else { worldIn.setBlockState(blockPosIn, iblockstate.withProperty(BlockAnvil.DAMAGE, l), 2); worldIn.playEvent(1030, blockPosIn, 0); } } else if (!worldIn.isRemote) { worldIn.playEvent(1030, blockPosIn, 0); } }
Source:
private void performAutosave(Campaign campaign) { try { String fileName = this.getAutosaveFilename(campaign); try (GZIPOutputStream output = new GZIPOutputStream(new FileOutputStream(fileName))) { PrintWriter writer = new PrintWriter(new OutputStreamWriter(output, "UTF-8")); campaign.writeToXml(writer); writer.flush(); writer.close(); } } catch (Exception ex) { this.logger.error(this.getClass(), "performAutosave", ex); } }

Target:
private void performAutosave(Campaign campaign) { try { String fileName = this.getAutosaveFilename(campaign); try (FileOutputStream fos = new FileOutputStream(fileName); GZIPOutputStream output = new GZIPOutputStream(fos)) { PrintWriter writer = new PrintWriter(new OutputStreamWriter(output, "UTF-8")); campaign.writeToXml(writer); writer.flush(); writer.close(); } } catch (Exception ex) { this.logger.error(this.getClass(), "performAutosave", ex); } }
Source:
private String getRemoteComment(AbstractBuild<?, ?> build, PrintStream logger, String commentFile, String maxSize) throws InterruptedException, IOException { if (CommonUtils.isBlank(commentFile)) { logger.println("[comment-file] no comment file configured"); return null; } FilePath workspace = build.getWorkspace(); FilePath[] src = workspace.list(commentFile); if (src.length == 0) { logger.println("[comment-file] no files found by path: '" + commentFile + "'"); return null; } if (src.length > 1) { logger.println("[comment-file] Found multiple matches. Reading first only."); } FilePath source = src[0]; int maxLength = 1000; if (!CommonUtils.isBlank(maxSize)) { maxLength = parseInt(maxSize, 10); } if (source.length() < maxLength) { maxLength = (int)source.length(); } byte[] buffer = new byte[maxLength]; source.read().read(buffer, 0, maxLength); return new String(buffer); }

Target:
private String getRemoteComment(AbstractBuild<?, ?> build, PrintStream logger, String commentFile, String maxSize) throws InterruptedException, IOException { if (CommonUtils.isBlank(commentFile)) { logger.println("[comment-file] no comment file configured"); return null; } FilePath workspace = build.getWorkspace(); FilePath[] src = workspace.list(commentFile); if (src.length == 0) { logger.println("[comment-file] no files found by path: '" + commentFile + "'"); return null; } if (src.length > 1) { logger.println("[comment-file] Found multiple matches. Reading first only."); } FilePath source = src[0]; int maxLength = DEFAULT_COMMENT_SIZE; if (!CommonUtils.isBlank(maxSize)) { maxLength = parseInt(maxSize, 10); } if (source.length() < maxLength) { maxLength = (int)source.length(); } byte[] buffer = new byte[maxLength]; source.read().read(buffer, 0, maxLength); return new String(buffer); }
Source:
private void updateRotationTimers() { lastRotate = System.currentTimeMillis(); if(log.isDebugEnabled() && rotateIntervalMs > 0) { log.debug("Update last rotation timer. Next rotation for will be in {}ms", tp, rotateIntervalMs); } if (rotateScheduleIntervalMs > 0) { nextScheduledRotate = DateTimeUtils.getNextTimeAdjustedByDay(System.currentTimeMillis(), rotateScheduleIntervalMs, timeZone); if (log.isDebugEnabled()) { log.debug("Update scheduled rotation timer. Next rotation for will be at {}", tp, new DateTime(nextScheduledRotate).withZone(timeZone).toString()); } } }

Target:
private void updateRotationTimers() { lastRotate = System.currentTimeMillis(); if(log.isDebugEnabled() && rotateIntervalMs > 0) { log.debug("Update last rotation timer. Next rotation for will be in {}ms", tp, rotateIntervalMs); } if (rotateScheduleIntervalMs > 0) { nextScheduledRotate = DateTimeUtils.getNextTimeAdjustedByDay(lastRotate, rotateScheduleIntervalMs, timeZone); if (log.isDebugEnabled()) { log.debug("Update scheduled rotation timer. Next rotation for will be at {}", tp, new DateTime(nextScheduledRotate).withZone(timeZone).toString()); } } }
Source:
private void getClassNamesOfPrimitiveFields(Schema schema, Set<String> result, Set<Schema> seenSchemas) { if (seenSchemas.contains(schema)) { return; } seenSchemas.add(schema); switch (schema.getType()) { case RECORD: for (Schema.Field field : schema.getFields()) { getClassNamesOfPrimitiveFields(field.schema(), result, seenSchemas); } break; case MAP: getClassNamesOfPrimitiveFields(schema.getValueType(), result, seenSchemas); break; case ARRAY: getClassNamesOfPrimitiveFields(schema.getElementType(), result, seenSchemas); break; case UNION: for (Schema s : schema.getTypes()) getClassNamesOfPrimitiveFields(s, result, seenSchemas); break; case ENUM: case FIXED: String convertedLogicalType = getConvertedLogicalType(schema); if (convertedLogicalType != null) { result.add(convertedLogicalType); } break; case NULL: break; case STRING: case BYTES: case INT: case LONG: case FLOAT: case DOUBLE: case BOOLEAN: result.add(javaType(schema, true)); break; default: throw new RuntimeException("Unknown type: " + schema); } }

Target:
private void getClassNamesOfPrimitiveFields(Schema schema, Set<String> result, Set<Schema> seenSchemas) { if (seenSchemas.contains(schema)) { return; } seenSchemas.add(schema); switch (schema.getType()) { case RECORD: for (Schema.Field field : schema.getFields()) { getClassNamesOfPrimitiveFields(field.schema(), result, seenSchemas); } break; case MAP: getClassNamesOfPrimitiveFields(schema.getValueType(), result, seenSchemas); break; case ARRAY: getClassNamesOfPrimitiveFields(schema.getElementType(), result, seenSchemas); break; case UNION: for (Schema s : schema.getTypes()) getClassNamesOfPrimitiveFields(s, result, seenSchemas); break; case NULL: break; case ENUM: case FIXED: case STRING: case BYTES: case INT: case LONG: case FLOAT: case DOUBLE: case BOOLEAN: result.add(javaType(schema, true)); break; default: throw new RuntimeException("Unknown type: " + schema); } }
Source:
public <T extends Modifiable> void update(T container, int delta) throws SlickException { if (input.isKeyPressed(keyCode)) { setChanged(); } notifyObservers(); }

Target:
public <T extends Modifiable> void update(T container, int delta) throws SlickException { if (input.isKeyPressed(keyCode)) { setChanged(); notifyObservers(); } }
Source:
public void testBraceElisionForAggregateInit2_WithNonAggregate_543038() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertNonProblem("foo({level1{{1,2}}})", 3); ICPPConstructor ctor = bh.assertNonProblem("level1(level0 a)", "level1"); ICPPASTSimpleTypeConstructorExpression typeConstructorExpr = bh.assertNode("level1{{1,2}};", "level1{{1,2}}"); IASTImplicitName[] implicitNames = ((IASTImplicitNameOwner) typeConstructorExpr).getImplicitNames(); assertEquals(ctor, implicitNames[0].resolveBinding()); bh.assertImplicitName("level1{1,2};", 6, IProblemBinding.class); bh.assertProblem("foo({{{1,2,3}}}", 3); }

Target:
public void testBraceElisionForAggregateInit2_WithNonAggregate_543038() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); bh.assertNonProblem("foo({level1{{1,2}}})", 3); bh.assertImplicitName("level1{{1,2}};", 6, ICPPConstructor.class); bh.assertImplicitName("level1{1,2};", 6, IProblemBinding.class); bh.assertProblem("foo({{{1,2,3}}}", 3); }
Source:
public synchronized static Workspace getWorkspace() throws Exception { if (instance == null) throw new IllegalStateException("Central has not been initialised"); if (workspace != null) return workspace; Workspace newWorkspace = null; try { Workspace.setDriver(Constants.BNDDRIVER_ECLIPSE); Workspace.addGestalt(Constants.GESTALT_INTERACTIVE, new Attrs()); newWorkspace = Workspace.getWorkspace(getWorkspaceDirectory()); newWorkspace.addBasicPlugin(new WorkspaceListener(newWorkspace)); newWorkspace.addBasicPlugin(instance.repoListenerTracker); newWorkspace.addBasicPlugin(getWorkspaceR5Repository()); Set<Object> progressPlugins = new HashSet<>(); for (Object plugin : newWorkspace.getPlugins()) { if (plugin instanceof ProgressPlugin) { progressPlugins.add(plugin); } } for (Object plugin : progressPlugins) { newWorkspace.removeBasicPlugin(plugin); } newWorkspace.addBasicPlugin(new JobProgress()); newWorkspace.getBuildOrder(); addCnfChangeListener(newWorkspace); workspaceRepositoryChangeDetector = new WorkspaceRepositoryChangeDetector(newWorkspace); synchronized (workspaceInitCallbackQueue) { workspace = newWorkspace; while (!workspaceInitCallbackQueue.isEmpty()) { Function<Workspace,Void> callback = workspaceInitCallbackQueue.remove(0); callback.apply(workspace); } } return workspace; } catch (final Exception e) { if (newWorkspace != null) { newWorkspace.close(); } throw e; } }

Target:
public static Workspace getWorkspace() throws Exception { synchronized (Central.class) { if (instance == null) throw new IllegalStateException("Central has not been initialised"); if (workspace != null) return workspace; Workspace newWorkspace = null; try { Workspace.setDriver(Constants.BNDDRIVER_ECLIPSE); Workspace.addGestalt(Constants.GESTALT_INTERACTIVE, new Attrs()); newWorkspace = Workspace.getWorkspace(getWorkspaceDirectory()); newWorkspace.addBasicPlugin(new WorkspaceListener(newWorkspace)); newWorkspace.addBasicPlugin(instance.repoListenerTracker); newWorkspace.addBasicPlugin(getWorkspaceR5Repository()); newWorkspace.addBasicPlugin(new JobProgress()); newWorkspace.getBuildOrder(); addCnfChangeListener(newWorkspace); workspaceRepositoryChangeDetector = new WorkspaceRepositoryChangeDetector(newWorkspace); workspace = newWorkspace; } catch (final Exception e) { if (newWorkspace != null) { newWorkspace.close(); } throw e; } } notifyCallbacks(); return workspace; }
Source:
public boolean validateSpinner(Spinner spinner) { return spinner.getAdapter().getCount() == 1 || (spinner.getSelectedItemPosition() >= 0 && spinner.getItemIdAtPosition(spinner.getSelectedItemPosition()) >= 1); }

Target:
private static boolean validateSpinner(Spinner spinner) { return spinner.getAdapter().getCount() == 1 || (spinner.getSelectedItemPosition() >= 0 && spinner.getItemIdAtPosition(spinner.getSelectedItemPosition()) >= 1); }
Source:
protected String getTestDataPath() { return "testData/quickfixes/ambiguous/"; }

Target:
protected String getTestDataPath() { return "testData/quickfixes/ambiguous_call/"; }
Source:
private SqlConnection getCompactionConnection() { SqlConnection sqlConnection = conns.get(); try { int originalNetworkTimeout = sqlConnection.getUnderlyingConnection().getNetworkTimeout(); int newNetworkMillis = config.compactionConnectionTimeout() > Integer.MAX_VALUE ? (int) config.compactionConnectionTimeout() : Integer.MAX_VALUE; log.info("Increased sql socket read timeout from to {}", SafeArg.of("originalNetworkTimeout", originalNetworkTimeout), SafeArg.of("newNetworkTimeout", newNetworkMillis)); sqlConnection.getUnderlyingConnection().setNetworkTimeout(compactionTimeoutExecutor, newNetworkMillis); } catch (SQLException e) { log.warn("Failed to increase socket read timeout for the connection. Encountered an exception:", e); } return sqlConnection; }

Target:
private SqlConnection getCompactionConnection() { SqlConnection sqlConnection = conns.get(); try { int originalNetworkTimeout = sqlConnection.getUnderlyingConnection().getNetworkTimeout(); int newNetworkMillis = Ints.saturatedCast(config.compactionConnectionTimeout()); log.info("Increased sql socket read timeout from to {}", SafeArg.of("originalNetworkTimeoutMillis", originalNetworkTimeout), SafeArg.of("newNetworkTimeoutMillis", newNetworkMillis)); sqlConnection.getUnderlyingConnection().setNetworkTimeout(compactionTimeoutExecutor, newNetworkMillis); } catch (SQLException e) { log.warn("Failed to increase socket read timeout for the connection. Encountered an exception:", e); } return sqlConnection; }
Source:
public static <T> T parseJson(Path path, Class<T> javaType) { if (!path.isAbsolute()) { path = path.toAbsolutePath(); } checkArgument(exists(path), "File does not exist: " + path); checkArgument(isReadable(path), "File is not readable: " + path); try { byte[] json = Files.readAllBytes(path); ObjectMapper mapper = new ObjectMapperProvider().get() .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); return mapper.readValue(json, javaType); } catch (IOException e) { throw new IllegalArgumentException(format("Invalid JSON file '%s' for '%s'", path, javaType), e); } }

Target:
public static <T> T parseJson(Path path, Class<T> javaType) { if (!path.isAbsolute()) { path = path.toAbsolutePath(); } checkArgument(exists(path), "File does not exist: %s", path); checkArgument(isReadable(path), "File is not readable: %s", path); try { byte[] json = Files.readAllBytes(path); ObjectMapper mapper = new ObjectMapperProvider().get() .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); return mapper.readValue(json, javaType); } catch (IOException e) { throw new IllegalArgumentException(format("Invalid JSON file '%s' for '%s'", path, javaType), e); } }
Source:
private String getNullTerminatedString(HpccSrcType stype) throws IOException { Charset charset = sbcSet; switch (stype) { case SINGLE_BYTE_CHAR: charset = sbcSet; break; case UTF16BE: charset = utf16beSet; break; case UTF16LE: charset = utf16leSet; break; default: throw new IOException("Unsupported source type for null terminated string: " + stype); } int strByteLen = 0; if (stype.isUTF16()) { int eosLocation = -1; while (eosLocation < 0) { int readSize = this.inputStream.available(); readSize = (readSize / 2) * 2; this.inputStream.mark(readSize); readIntoScratchBuffer(strByteLen, readSize); for (int j = 0; j < readSize-1; j += 2) { if (scratchBuffer[j] == '\0' && scratchBuffer[j + 1] == '\0') { eosLocation = j; break; } } if (eosLocation != -1) { strByteLen += eosLocation; this.inputStream.reset(); this.inputStream.skip(eosLocation + 2); break; } else { strByteLen += readSize; } } } else { int eosLocation = -1; while (eosLocation < 0) { int readSize = this.inputStream.available(); this.inputStream.mark(readSize); readIntoScratchBuffer(strByteLen, readSize); for (int j = 0; j < readSize; j++) { if (scratchBuffer[j] == '\0') { eosLocation = j; break; } } if (eosLocation != -1) { strByteLen += eosLocation; this.inputStream.reset(); this.inputStream.skip(eosLocation + 1); break; } else { strByteLen += readSize; } } } return new String(scratchBuffer,0,strByteLen,charset); }

Target:
private String getNullTerminatedString(HpccSrcType stype) throws IOException { Charset charset = sbcSet; switch (stype) { case SINGLE_BYTE_CHAR: charset = sbcSet; break; case UTF16BE: charset = utf16beSet; break; case UTF16LE: charset = utf16leSet; break; default: throw new IOException("Unsupported source type for null terminated string: " + stype); } int eosLocation = -1; int strByteLen = 0; if (stype.isUTF16()) { while (eosLocation < 0) { int readSize = this.inputStream.available(); readSize = (readSize / 2) * 2; this.inputStream.mark(readSize); readIntoScratchBuffer(strByteLen, readSize); for (int j = 0; j < readSize-1; j += 2) { if (scratchBuffer[j] == '\0' && scratchBuffer[j + 1] == '\0') { eosLocation = j; break; } } if (eosLocation != -1) { strByteLen += eosLocation; this.inputStream.reset(); this.inputStream.skip(eosLocation + 2); break; } else { strByteLen += readSize; } } } else { while (eosLocation < 0) { int readSize = this.inputStream.available(); this.inputStream.mark(readSize); readIntoScratchBuffer(strByteLen, readSize); for (int j = 0; j < readSize; j++) { if (scratchBuffer[j] == '\0') { eosLocation = j; break; } } if (eosLocation != -1) { strByteLen += eosLocation; this.inputStream.reset(); this.inputStream.skip(eosLocation + 1); break; } else { strByteLen += readSize; } } } return new String(scratchBuffer,0,strByteLen,charset); }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { LOGGER.debug("Performing doFilter() on CsrfFilter"); HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; String targetContextPath = httpRequest.getRequestURI(); String requestMethod = httpRequest.getMethod(); String userAgentHeader = httpRequest.getHeader(HttpHeaders.USER_AGENT); if (protectedContexts.stream().anyMatch(targetContextPath::startsWith)) { String sourceOrigin = httpRequest.getHeader(ORIGIN_HEADER); String sourceReferer = httpRequest.getHeader(REFERER_HEADER); String csrfHeader = httpRequest.getHeader(CSRF_HEADER); if (sourceOrigin == null && sourceReferer == null) { respondForbidden( httpResponse, "Cross-site check failure: Incoming request did not have an Origin or Referer header."); return; } if (!isTrustedAuthority(sourceOrigin) && !isTrustedAuthority(sourceReferer)) { respondForbidden( httpResponse, "Cross-site check failure: Neither the Origin nor Referer header matched a system internal or external name."); return; } String whitelistKey = getMultivaluedMapKey(BROWSER_PROTECTION_WHITELIST, targetContextPath); if (csrfHeader == null && !(whitelistKey != null && BROWSER_PROTECTION_WHITELIST.get(whitelistKey).contains(requestMethod))) { respondForbidden( httpResponse, "Cross-site check failure: Request did not have required X-Requested-With header."); return; } } if (targetContextPath.startsWith(SERVICE_CONTEXT)) { String whitelistKey = getMultivaluedMapKey(SYSTEM_PROTECTION_WHITELIST, targetContextPath); if (userAgentHeader != null && !userAgentHeader.equals("Apache-CXF/3.2.5") && !userAgentHeader.equals("Google-HTTP-Java-Client/1.22.0 (gzip)") && !(whitelistKey != null && SYSTEM_PROTECTION_WHITELIST.get(whitelistKey).contains(requestMethod))) { respondForbidden( httpResponse, "Cross-site check failure: Request did not have required X-Requested-With header."); return; } } chain.doFilter(request, response); }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { LOGGER.debug("Performing doFilter() on CsrfFilter"); HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; String targetContextPath = httpRequest.getRequestURI(); String requestMethod = httpRequest.getMethod(); String userAgentHeader = httpRequest.getHeader(HttpHeaders.USER_AGENT); if (protectedContexts.stream().anyMatch(targetContextPath::startsWith) && doBrowserProtectionFilter(httpRequest, httpResponse, targetContextPath, requestMethod)) { return; } if (targetContextPath.startsWith(SERVICE_CONTEXT) && doSystemProtectionFilter( httpResponse, targetContextPath, requestMethod, userAgentHeader)) { return; } chain.doFilter(request, response); }
Source:
public void sendFeedbackToPeergos() throws Exception { UserContext u1 = PeergosNetworkUtils.ensureSignedUp("peergos", "testpassword", network, crypto); UserContext u2 = PeergosNetworkUtils.ensureSignedUp("w", "w", network, crypto); String feedback = "Here's some constructive feedback!"; CompletableFuture<Boolean> testFeedbackSubmission = u2.submitFeedback(feedback); assertTrue("Feedback submission was successful!", testFeedbackSubmission.get() == true); List<FollowRequestWithCipherText> u1Requests = u1.processFollowRequests().get(); u1.sendReplyFollowRequest(u1Requests.get(0), true, true).get(); Optional<FileWrapper> u2ToU1 = u1.getByPath("/" + u2.username + "/feedback").get(); Set<FileWrapper> feedbackDirectoryContents = u2ToU1.get().getChildren(u2.network).get(); assertTrue("Feedback directory is non-empty", !feedbackDirectoryContents.isEmpty()); for (FileWrapper feedbackFile : feedbackDirectoryContents) { assertTrue("Feedback file is readable", feedbackFile.isReadable()); AsyncReader inputStream = feedbackFile .getInputStream(u1.network, u1.crypto.random, l -> {}) .get(); byte[] fileContents = Serialize.readFully(inputStream, feedbackFile.getFileProperties().size).get(); String reportedFeedback = new String(fileContents); assertTrue("Feedback file contents correct", Objects.equals(feedback, reportedFeedback)); } }

Target:
public void sendFeedbackToPeergos() throws Exception { UserContext peergos = PeergosNetworkUtils.ensureSignedUp("peergos", "testpassword", network, crypto); UserContext newUser = PeergosNetworkUtils.ensureSignedUp("newUser", "newUserPassword", network, crypto); String feedback = "Here's some constructive feedback!"; CompletableFuture<Boolean> testFeedbackSubmission = newUser.submitFeedback(feedback); assertTrue("Feedback submission was successful!", testFeedbackSubmission.get() == true); List<FollowRequestWithCipherText> peergosRequests = peergos.processFollowRequests().get(); for (FollowRequestWithCipherText request : peergosRequests) { peergos.sendReplyFollowRequest(request, true, true).get(); } Optional<FileWrapper> newUserToPeergos = peergos.getByPath("/" + newUser.username + "/feedback").get(); Set<FileWrapper> feedbackDirectoryContents = newUserToPeergos.get().getChildren(newUser.network).get(); assertTrue("Feedback directory is non-empty", !feedbackDirectoryContents.isEmpty()); for (FileWrapper feedbackFile : feedbackDirectoryContents) { assertTrue("Feedback file is readable", feedbackFile.isReadable()); AsyncReader inputStream = feedbackFile .getInputStream(peergos.network, peergos.crypto.random, l -> {}) .get(); byte[] fileContents = Serialize.readFully(inputStream, feedbackFile.getFileProperties().size).get(); String reportedFeedback = new String(fileContents); assertTrue("Feedback file contents correct", Objects.equals(feedback, reportedFeedback)); } }
Source:
public void setSettings(ConfigurationSettingBoolean... settings) throws AlgorithmConfigurationException { if (getNumberOfSettings() != ConfigurationRequirement.ARBITRARY_NUMBER_OF_VALUES && settings.length != getNumberOfSettings()) { throw new AlgorithmConfigurationException("The number of settings does not match the expected number!"); } this.settings = settings; }

Target:
public void setSettings(ConfigurationSettingBoolean... settings) throws AlgorithmConfigurationException { checkNumberOfSettings(settings.length); this.settings = settings; }
Source:
public void searchForProcesses() throws Exception { desktopPage.searchInSearchField("process"); int numberOfResults = searchResultPage.getNumberOfResults(); assertEquals("There should be two processes found",2,numberOfResults); searchResultPage.searchInSearchField("proc"); numberOfResults = searchResultPage.getNumberOfResults(); assertEquals("There should be two processes found",2,numberOfResults); searchResultPage.searchInSearchField("möhö"); numberOfResults = searchResultPage.getNumberOfResults(); assertEquals("There should be no process found",0,numberOfResults); }

Target:
public void searchForProcesses() throws Exception { desktopPage.searchInSearchField("process"); int numberOfResults = searchResultPage.getNumberOfResults(); assertEquals("There should be two processes found",2,numberOfResults); searchResultPage.searchInSearchField("proc"); numberOfResults = searchResultPage.getNumberOfResults(); assertEquals("There should be two processes found",2,numberOfResults); searchResultPage.searchInSearchField("möhö"); numberOfResults = searchResultPage.getNumberOfResults(); }
Source:
private void register(VillagerCareer career) { Validate.isTrue(!careers.contains(career), "Attempted to register career that is already registered."); Validate.isTrue(career.profession == this, "Attempted to register career for the wrong profession."); career.id = careers.size(); careers.add(career); TRADES.put(career, new ArrayList<List<ITradeList>>()); }

Target:
private void register(VillagerCareer career) { Validate.isTrue(!careers.contains(career), "Attempted to register career that is already registered."); Validate.isTrue(career.profession == this, "Attempted to register career for the wrong profession."); career.id = careers.size(); careers.add(career); }
Source:
RtAssignees(final Repo repo, final Request req) { repo.github(); req.body(); }

Target:
RtAssignees(final Repo repo, final Request req) { throw new UnsupportedOperationException(); }
Source:
protected boolean canDoAction() { parameter = getParameters(); if (parameter == null || parameter.getVolumeId() == null || parameter.getSlaveNodeIp() == null || parameter.getSlaveVolumeName() == null) { return false; } masterVolume = getGlusterVolumeDao().getById(parameter.getVolumeId()); if (masterVolume.getStatus() == GlusterStatus.DOWN) { return false; } return true; }

Target:
protected boolean canDoAction() { parameter = getParameters(); if (parameter == null || parameter.getVolumeId() == null || parameter.getSlaveNodeIp() == null || parameter.getSlaveVolumeName() == null) { return false; } if(masterVolume == null) { return false; } masterVolume = getGlusterVolumeDao().getById(parameter.getVolumeId()); if (masterVolume.getStatus() == GlusterStatus.DOWN) { return false; } return true; }
Source:
public void compactInternally() { if (config.enableOracleEnterpriseFeatures()) { try { conns.get().executeUnregisteredQuery( "ALTER TABLE " + oracleTableNameGetter.getInternalShortTableName(conns, tableRef) + " MOVE ONLINE"); } catch (PalantirSqlException e) { log.error("Tried to clean up bloat after a sweep operation," + " but underlying Oracle database or configuration does not support this" + " (Enterprise Edition that requires this user to be able to perform DDL operations)" + " feature online. Since this can't be automated in your configuration," + " good practice would be do to occasional offline manual maintenance of rebuilding" + " IOT tables to compensate for bloat. You can contact Palantir Support if you'd" + " like more information. Underlying error was: {}", tableRef, e.getMessage()); } catch (TableMappingNotFoundException e) { throw new RuntimeException(e); } } else { try { log.warn("Tried to clean up table {}, but couldn't, because enterprise features are disabled. " + "This means that even if you are running sweep, you will need to manually clean up your " + "tables, otherwise disk usage will continually increase. To free up space, run the SHRINK " + "command on the underlying oracle table, {}.", tableRef, oracleTableNameGetter.getInternalShortTableName(conns, tableRef)); } catch (TableMappingNotFoundException e) { throw new RuntimeException(e); } } }

Target:
public void compactInternally() { String compactionFailureTemplate = "Tried to clean up bloat after a sweep operation," + " but underlying Oracle database or configuration does not support this feature online. " + " Since this can't be automated in your configuration," + " good practice would be do to occasional offline manual maintenance of rebuilding" + " IOT tables to compensate for bloat. You can contact Palantir Support if you'd" + " like more information."; if (config.enableOracleEnterpriseFeatures()) { try { conns.get().executeUnregisteredQuery( "ALTER TABLE " + oracleTableNameGetter.getInternalShortTableName(conns, tableRef) + " MOVE ONLINE"); } catch (PalantirSqlException e) { log.error(compactionFailureTemplate + " Underlying error was: {}", tableRef, "(Enterprise Edition that requires this user to be able to perform DDL operations)", e.getMessage()); } catch (TableMappingNotFoundException e) { throw new RuntimeException(e); } } else { log.warn(compactionFailureTemplate, tableRef, "(If you are running against Enterprise Edition," + " you can set enableOracleEnterpriseFeatures to true in the configuration.)"); } }
Source:
public boolean addAll(final int index, final Collection<? extends T> coll) { try { return this.origin.addAll(index, coll); } catch (final IndexOutOfBoundsException ex) { throw new IllegalArgumentException(this.message, ex); } }

Target:
public boolean addAll(final int index, final Collection<? extends T> coll) { try { return this.origin.addAll(index, coll); } catch (final IndexOutOfBoundsException ex) { throw this.wrapException(ex); } }