auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void getArgumentsFromPropertyFile(Map<String, String> argMap) throws IOException { if (argMap.containsKey(PROPERTY_FILE)) { Properties props = new Properties(); props.keySet(); String value = argMap.get(PROPERTY_FILE); if (value.startsWith("\"") && value.endsWith("\"")) { value= value.substring(1, value.length()-1); } FileInputStream in = new FileInputStream(argMap.get(PROPERTY_FILE)); props.load(in); in.close(); for (Object propertyKeyObject : props.keySet() ){ String key =(String)propertyKeyObject; if(argMap.get(key)==null){ argMap.put(key, props.getProperty(key)); } } } }

Target:
private static void getArgumentsFromPropertyFile(Map<String, String> argMap) throws IOException { if (argMap.containsKey(PROPERTY_FILE)) { Properties props = new Properties(); props.keySet(); String value = argMap.get(PROPERTY_FILE); if (value.startsWith("\"") && value.endsWith("\"")) { value = value.substring(1, value.length() - 1); } FileInputStream in = null; try { in = new FileInputStream(argMap.get(PROPERTY_FILE)); props.load(in); } catch (IOException e) { LOGGER.error("Unable to read file "+argMap.get("propertyfilepath")); exitVM(1); } finally { if (in != null) { in.close(); } } for (Object propertyKeyObject : props.keySet() ) { String key = (String) propertyKeyObject; if (argMap.get(key) == null) { argMap.put(key, props.getProperty(key)); } } } }
Source:
public CtfTmfEventType(String eventName, ITmfTrace trace, ITmfEventField content) { super(CONTEXT_ID + "/" + (trace != null ? trace.getPath() : CONTEXT_ID), eventName, content); }

Target:
public CtfTmfEventType(String eventName, ITmfTrace trace, ITmfEventField content) { super(computeContextName(trace), eventName, content); }
Source:
String parse(String markdown) { String[] lines = markdown.split("\n"); StringBuilder result = new StringBuilder(); boolean activeList = false; for (int i = 0; i < lines.length; i++) { String lineResult = parseLine(lines[i]); if(lineResult.matches(".*(<li>).*") && !activeList){ activeList = true; result.append("<ul>"); result.append(lineResult); } else if(!lineResult.matches(".*(<li>).*") && activeList){ activeList = false; result.append("</ul>"); result.append(lineResult); } else { result.append(lineResult); } } if(activeList){ result.append("</ul>"); } return result.toString(); }

Target:
String parse(String markdown) { String[] lines = markdown.split("\n"); StringBuilder result = new StringBuilder(); boolean activeList = false; for (int i = 0; i < lines.length; i++) { String lineResult = parseLine(lines[i]); if (lineResult.matches("(<li>).*") && !activeList) { activeList = true; result.append("<ul>"); result.append(lineResult); } else if (!lineResult.matches("(<li>).*") && activeList) { activeList = false; result.append("</ul>"); result.append(lineResult); } else { result.append(lineResult); } } if (activeList) { result.append("</ul>"); } return result.toString(); }
Source:
public int createUploadNotification(Context context, String programName) { if (context == null || programName == null) { return -1; } initNotificationManager(context); Intent uploadIntent = new Intent(context, MainMenuActivity.class); uploadIntent.setAction(Intent.ACTION_MAIN); uploadIntent = uploadIntent.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); PendingIntent pendingIntent = PendingIntent.getActivity(context, getId(), uploadIntent, PendingIntent.FLAG_CANCEL_CURRENT); NotificationData data = new NotificationData(context, pendingIntent, R.drawable.ic_stat, programName, R.string.notification_upload_title_pending, R.string.notification_upload_title_finished, R.string.notification_upload_pending, R.string.notification_upload_finished); int id = createNotification(context, data); showOrUpdateNotification(id, 0); return id; }

Target:
public int createUploadNotification(Context context, String programName) { if (context == null || programName == null) { return -1; } initNotificationManager(context); Intent uploadIntent = new Intent(context, MainMenuActivity.class); uploadIntent.setAction(Intent.ACTION_MAIN); uploadIntent = uploadIntent.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); PendingIntent pendingIntent = PendingIntent.getActivity(context, notificationId, uploadIntent, PendingIntent.FLAG_CANCEL_CURRENT); NotificationData data = new NotificationData(context, pendingIntent, R.drawable.ic_stat, programName, R.string.notification_upload_title_pending, R.string.notification_upload_title_finished, R.string.notification_upload_pending, R.string.notification_upload_finished); int id = createNotification(context, data); showOrUpdateNotification(id, 0); return id; }
Source:
public AdaptiveSubmissionResult parseFromJson(final String json) { if (json.trim().isEmpty()) { logger.info("Attempted to parse empty string as JSON"); throw new IllegalArgumentException("Empty input"); } try { Gson gson = new GsonBuilder() .registerTypeAdapter( SubmissionResult.Status.class, new SubmissionResultParser.StatusDeserializer()) .registerTypeAdapter( StackTraceElement.class, new StackTraceSerializer()) .registerTypeAdapter( ImmutableList.class, new SubmissionResultParser.ImmutableListJsonDeserializer()) .create(); AdaptiveSubmissionResult result = gson.fromJson(json, AdaptiveSubmissionResult.class); JsonObject output = new JsonParser().parse(json).getAsJsonObject(); JsonElement validationElement = output.get("validations"); return result; } catch (RuntimeException runtimeException) { logger.warn("Failed to parse adaptive submission result", runtimeException); throw new RuntimeException( "Failed to parse adaptive submission result: " + runtimeException.getMessage(), runtimeException); } }

Target:
public AdaptiveSubmissionResult parseFromJson(final String json) { if (json.trim().isEmpty()) { logger.info("Attempted to parse empty string as JSON"); throw new IllegalArgumentException("Empty input"); } try { Gson gson = new GsonBuilder() .registerTypeAdapter( SubmissionResult.Status.class, new SubmissionResultParser.StatusDeserializer()) .registerTypeAdapter( StackTraceElement.class, new StackTraceSerializer()) .registerTypeAdapter( ImmutableList.class, new SubmissionResultParser.ImmutableListJsonDeserializer()) .create(); AdaptiveSubmissionResult result = gson.fromJson(json, AdaptiveSubmissionResult.class); return result; } catch (RuntimeException runtimeException) { logger.warn("Failed to parse adaptive submission result", runtimeException); throw new RuntimeException( "Failed to parse adaptive submission result: " + runtimeException.getMessage(), runtimeException); } }
Source:
private void iccLockChanged(boolean success, int attemptsRemaining) { if(DBG) Log.d(TAG, "iccLockChanged success: "+success); if (success) { mPinToggle.setChecked(mToState); } else { setRemainingAttempts(true, attemptsRemaining); createCustomTextToast(getPinPasswordErrorMessage(attemptsRemaining)).show(); } mPinToggle.setEnabled(true); resetDialogState(); }

Target:
private void iccLockChanged(boolean success, int attemptsRemaining) { if(DBG) Log.d(TAG, "iccLockChanged success: "+success); if (success) { mPinToggle.setChecked(mToState); } else { showCustomTextToast(getPinPasswordErrorMessage(attemptsRemaining)); } mPinToggle.setEnabled(true); resetDialogState(); }
Source:
private String getShortName(Concept concept) { User authenticatedUser = Context.getAuthenticatedUser(); String shortName = null; if(authenticatedUser != null) { String userDefaultLocale = authenticatedUser.getUserProperty(OpenmrsConstants.USER_PROPERTY_DEFAULT_LOCALE); Locale locale = LocaleUtility.fromSpecification(userDefaultLocale); ConceptName shortNameInLocale = concept.getShortNameInLocale(locale); if(shortNameInLocale != null) { shortName = shortNameInLocale.getName(); } else { ConceptName fullySpecifiedName = concept.getFullySpecifiedName(locale); if (fullySpecifiedName != null) { shortName = fullySpecifiedName.getName(); } else { String systemDefaultLocale = Context.getAdministrationService().getGlobalProperty("default_locale"); if (systemDefaultLocale != null) { Locale defLocale = LocaleUtility.fromSpecification(systemDefaultLocale); shortName = concept.getFullySpecifiedName(defLocale).getName(); } } } } return shortName; }

Target:
private String getShortName(Concept concept) { User authenticatedUser = Context.getAuthenticatedUser(); String shortName = null; if (authenticatedUser != null) { Locale userDefaultLocale = getUserDefaultLocale(authenticatedUser); shortName = getAnAvailableName(concept, userDefaultLocale); if (shortName == null) { Locale systemDefaultLocale = getSystemDefaultLocale(); shortName = getAnAvailableName(concept, systemDefaultLocale); } } if (shortName == null) { shortName = concept.getName().getName(); } return shortName; }
Source:
public void visit(ClazzNode clazzNode) { cn = clazzNode; blockCount = 0; cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES); cw.visit(52, ACC_PUBLIC + ACC_SUPER, clazzNode.getName(), null, clazzNode.getSuperclass(), null); cw.visitInnerClass("java/lang/Object", "org/twnc/runtime/Core", "Object", ACC_PUBLIC + ACC_STATIC); mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitMethodInsn(INVOKESPECIAL, clazzNode.getSuperclass(), "<init>", "()V", false); mv.visitInsn(RETURN); mv.visitMaxs(0, 0); mv.visitEnd(); if (clazzNode.hasMain()) { mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "main", "([Ljava/lang/String;)V", null, null); mv.visitCode(); mv.visitTypeInsn(NEW, clazzNode.getName()); mv.visitInsn(DUP); mv.visitMethodInsn(INVOKESPECIAL, clazzNode.getName(), "<init>", "()V", false); mv.visitMethodInsn(INVOKEVIRTUAL, clazzNode.getName(), "_main", "()L" + OBJ, false); mv.visitInsn(POP); mv.visitInsn(RETURN); mv.visitMaxs(0, 0); mv.visitEnd(); } super.visit(clazzNode); cw.visitEnd(); String path = outDir + clazzNode.getName() + ".class"; try (OutputStream out = new FileOutputStream(path)) { out.write(cw.toByteArray()); } catch (IOException e) { e.printStackTrace(); } }

Target:
public void visit(ClazzNode clazzNode) { cn = clazzNode; blockCount = 0; cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES); cw.visit(52, ACC_PUBLIC + ACC_SUPER, clazzNode.getName(), null, clazzNode.getSuperclass(), null); cw.visitInnerClass("java/lang/Object", "org/twnc/runtime/Core", "Object", ACC_PUBLIC + ACC_STATIC); mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitMethodInsn(INVOKESPECIAL, clazzNode.getSuperclass(), "<init>", "()V", false); mv.visitInsn(RETURN); mv.visitMaxs(0, 0); mv.visitEnd(); if (clazzNode.hasMain()) { mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "main", "([Ljava/lang/String;)V", null, null); mv.visitCode(); mv.visitTypeInsn(NEW, clazzNode.getName()); mv.visitInsn(DUP); mv.visitMethodInsn(INVOKESPECIAL, clazzNode.getName(), "<init>", "()V", false); mv.visitMethodInsn(INVOKEVIRTUAL, clazzNode.getName(), "_main", "()" + OBJ, false); mv.visitInsn(POP); mv.visitInsn(RETURN); mv.visitMaxs(0, 0); mv.visitEnd(); } super.visit(clazzNode); cw.visitEnd(); String path = outDir + clazzNode.getName() + ".class"; try (OutputStream out = new FileOutputStream(path)) { out.write(cw.toByteArray()); } catch (IOException e) { e.printStackTrace(); } }
Source:
public static boolean softenLanding(final Player player) { if (Commands.isToggledForAll && ConfigManager.defaultConfig.get().getBoolean("Properties.TogglePassivesWithAllBending")) { return false; } final Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN); final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player); if (bPlayer == null) { return false; } else if (bPlayer.canMetalbend() && ElementalAbility.isMetalBlock(block)) { return true; } if ((player.getLocation().getY() % 1) != 0) player.teleport(player.getLocation().add(0, 0.1, 0)); if (ElementalAbility.isEarth(block)) { for (final Block affectedBlock : GeneralMethods.getBlocksAroundPoint(block.getLocation(), 2)) { if (ElementalAbility.isEarth(affectedBlock)) { if (GeneralMethods.isSolid(affectedBlock.getRelative(BlockFace.DOWN))) { Material sand = Material.SAND; if (affectedBlock.getType() == Material.RED_SANDSTONE) { sand = Material.RED_SAND; } final TempBlock tb = new TempBlock(affectedBlock, sand); if (!SAND_BLOCKS.contains(tb)) { SAND_BLOCKS.add(tb); tb.setRevertTime(getDuration()); tb.setRevertTask(() -> SAND_BLOCKS.remove(tb)); } } } } return true; } return (TempBlock.isTempBlock(block) && EarthAbility.isEarthbendable(TempBlock.get(block).getBlock().getType(), true, true, false)) || EarthAbility.isEarthbendable(block.getType(), true, true, false) || ElementalAbility.isTransparent(player, block); }

Target:
public static boolean softenLanding(final Player player) { if (Commands.isToggledForAll && ConfigManager.defaultConfig.get().getBoolean("Properties.TogglePassivesWithAllBending")) { return false; } final Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN); final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player); if (bPlayer == null) { return false; } else if (bPlayer.canMetalbend() && ElementalAbility.isMetalBlock(block)) { return true; } if (ElementalAbility.isEarth(block)) { for (final Block affectedBlock : GeneralMethods.getBlocksAroundPoint(block.getLocation(), 2)) { if (ElementalAbility.isEarth(affectedBlock)) { if (GeneralMethods.isSolid(affectedBlock.getRelative(BlockFace.DOWN))) { Material sand = Material.SAND; if (affectedBlock.getType() == Material.RED_SANDSTONE) { sand = Material.RED_SAND; } final TempBlock tb = new TempBlock(affectedBlock, sand); if (!SAND_BLOCKS.contains(tb)) { SAND_BLOCKS.add(tb); tb.setRevertTime(getDuration()); tb.setRevertTask(() -> SAND_BLOCKS.remove(tb)); } } } } if ((player.getLocation().getY() % 1) != 0) { player.setVelocity(new Vector(0, 0.07, 0)); } return true; } return (TempBlock.isTempBlock(block) && EarthAbility.isEarthbendable(TempBlock.get(block).getBlock().getType(), true, true, false)) || EarthAbility.isEarthbendable(block.getType(), true, true, false) || ElementalAbility.isTransparent(player, block); }
Source:
public void throwsWithTooLargeContentLength() { SupportedCipherDetails cipherDetails = AesGcmCipherDetails.INSTANCE_128_BIT; byte[] keyBytes = SecretKeyUtils.generate(cipherDetails).getEncoded(); SecretKey key = SecretKeyUtils.loadKey(ByteUtils.subArray(keyBytes, 2), cipherDetails); ExposedStringEntity stringEntity = new ExposedStringEntity("boo", Charsets.US_ASCII); EncryptingEntity entity = new EncryptingEntity(key, cipherDetails, stringEntity); }

Target:
public void throwsWithTooLargeContentLength() { SupportedCipherDetails cipherDetails = AesGcmCipherDetails.INSTANCE_128_BIT; byte[] keyBytes = SecretKeyUtils.generate(cipherDetails).getEncoded(); SecretKey key = SecretKeyUtils.loadKey(Arrays.copyOfRange(keyBytes, 2, 10), cipherDetails); ExposedStringEntity stringEntity = new ExposedStringEntity("boo", Charsets.US_ASCII); EncryptingEntity entity = new EncryptingEntity(key, cipherDetails, stringEntity); }
Source:
default boolean startsWith(Iterable<? extends T> that, int offset) { if(offset < 0) return false; if(that instanceof IndexedSeq) { IndexedSeq<? extends T> dhat = (IndexedSeq<? extends T>) that; int i = offset; int j = 0; int thisLen = length(); int thatLen = dhat.length(); while(i < thisLen && j < thatLen && Objects.equals(this.get(i), dhat.get(j))) { i++; j++; } return j == thatLen; } else { int i = offset; int thisLen = length(); java.util.Iterator<? extends T> thatElems = that.iterator(); while(i < thisLen && thatElems.hasNext()) { if(!Objects.equals(this.get(i), thatElems.next())) return false; i++; } return !thatElems.hasNext(); } }

Target:
default boolean startsWith(Iterable<? extends T> that, int offset) { Objects.requireNonNull(that, "that is null"); if(offset < 0) return false; if(that instanceof IndexedSeq) { IndexedSeq<? extends T> dhat = (IndexedSeq<? extends T>) that; int i = offset; int j = 0; int thisLen = length(); int thatLen = dhat.length(); while(i < thisLen && j < thatLen && Objects.equals(this.get(i), dhat.get(j))) { i++; j++; } return j == thatLen; } else { int i = offset; int thisLen = length(); java.util.Iterator<? extends T> thatElems = that.iterator(); while(i < thisLen && thatElems.hasNext()) { if(!Objects.equals(this.get(i), thatElems.next())){ return false; } i++; } return !thatElems.hasNext(); } }
Source:
private void testChannelDelete() { channelService.delete(fromFileChannel.getModuleName()); boolean doesModuleExistsAfterDeletion = channelService.channelExists(fromFileChannel.getModuleName()); assertFalse(doesModuleExistsAfterDeletion); }

Target:
private void testChannelDelete() { boolean moduleExistsBeforeDeletion = channelService.channelExists(fromFileChannel.getModuleName()); assertTrue(moduleExistsBeforeDeletion); channelService.delete(fromFileChannel.getModuleName()); boolean moduleExistsAfterDeletion = channelService.channelExists(fromFileChannel.getModuleName()); assertFalse(moduleExistsAfterDeletion); }
Source:
public void setup(Context.OperatorContext context) { this.context = context; LOG.info("Initial Partition Count: {}", currentpartitionCount()); inFlightRecoveryMessages.clear(); inFlightRecoveryMessagesPartition.clear(); inFlightRecoveryMessagesDR.clear(); super.setConnectRetries(this.connectRetries); super.setReconnectRetries(this.reconnectRetries); super.setup(context); LOG.info("Operator ID = " + context.getId()); windowTime = context.getValue(OperatorContext.APPLICATION_WINDOW_COUNT) * context.getValue(DAGContext.STREAMING_WINDOW_SIZE_MILLIS); arrivedMessagesToProcess = new ArrayBlockingQueue<BytesXMLMessage>(Integer.parseInt(this.unackedMessageLimit)); unackedMessages = new ArrayBlockingQueue<BytesXMLMessage>((Integer.parseInt(this.unackedMessageLimit)) * (context.getValue(OperatorContext.APPLICATION_WINDOW_COUNT)) * 2); endpoint = factory.createQueue(this.endpointName); if (windowId > idempotentStorageManager.getLargestRecoveryWindow()) { super.startConsumer(); } try { operatorRecoveredWindows = idempotentStorageManager.getWindowIds(context.getId()); if (operatorRecoveredWindows != null) { Arrays.sort(operatorRecoveredWindows); } } catch (IOException e) { DTThrowable.rethrow(e); } }

Target:
public void setup(Context.OperatorContext context) { super.setup(context); flowHandler = new MessageHandler(arrivedMessagesToProcess); calculatePartitionCount(context); LOG.info("Initial Partition Count: {}", partitionCount); inFlightRecoveryMessages.clear(); inFlightRecoveryMessagesPartition.clear(); inFlightRecoveryMessagesDR.clear(); LOG.info("Operator ID = " + context.getId()); windowTime = context.getValue(OperatorContext.APPLICATION_WINDOW_COUNT) * context.getValue(DAGContext.STREAMING_WINDOW_SIZE_MILLIS); arrivedMessagesToProcess = new ArrayBlockingQueue<BytesXMLMessage>(unackedMessageLimit); unackedMessages = new ArrayBlockingQueue<BytesXMLMessage>(unackedMessageLimit * (context.getValue(OperatorContext.APPLICATION_WINDOW_COUNT)) * 2); endpoint = factory.createQueue(this.endpointName); }
Source:
static public void init(File extractDir) throws NativeIntegrationUnavailableException, NativeException { synchronized (Native.class) { if (loader == null) { Platform platform = Platform.current(); try { loader = new NativeLibraryLoader(platform, new NativeLibraryLocator(extractDir)); loader.load(platform.getLibraryName(), platform.getLibraryVariants()); long nativeVersion = NativeLibraryFunctions.getVersion(); if (nativeVersion != NativeVersion.VERSION) { throw new NativeException(String.format("Unexpected native library version loaded. Expected %s, was %s.", NativeVersion.VERSION, nativeVersion)); } NativeLogger.initLogging(Native.class); } catch (NativeException e) { throw e; } catch (Throwable t) { throw new NativeException("Failed to initialise native integration.", t); } } } }

Target:
static public void init(File extractDir) throws NativeIntegrationUnavailableException, NativeException { synchronized (Native.class) { if (loader == null) { Platform platform = Platform.current(); try { loader = new NativeLibraryLoader(platform, new NativeLibraryLocator(extractDir)); loader.load(platform.getLibraryName(), platform.getLibraryVariants()); String nativeVersion = NativeLibraryFunctions.getVersion(); if (!nativeVersion.equals(NativeVersion.VERSION)) { throw new NativeException(String.format("Unexpected native library version loaded. Expected %s, was %s.", NativeVersion.VERSION, nativeVersion)); } NativeLogger.initLogging(Native.class); } catch (NativeException e) { throw e; } catch (Throwable t) { throw new NativeException("Failed to initialise native integration.", t); } } } }
Source:
private void setSamplePurposes(Collection<SamplePurpose> samplePurposes) { Map<Long, SamplePurpose> mapById = new HashMap<>(); Map<String, SamplePurpose> mapByAlias = new HashMap<>(); for (SamplePurpose sp : samplePurposes) { if (mapByAlias.containsKey(sp.getAlias())) { throw new IllegalStateException("Duplicate SamplePurpose alias: " + sp.getAlias()); } mapByAlias.put(sp.getAlias(), sp); mapById.put(sp.getId(), sp); } this.samplePurposeById = mapById; this.samplePurposeByAlias = mapByAlias; }

Target:
private void setSamplePurposes(Collection<SamplePurpose> samplePurposes) { Map<Long, SamplePurpose> mapById = new UniqueKeyHashMap<>(); Map<String, SamplePurpose> mapByAlias = new UniqueKeyHashMap<>(); for (SamplePurpose sp : samplePurposes) { mapByAlias.put(sp.getAlias(), sp); mapById.put(sp.getId(), sp); } this.samplePurposeById = mapById; this.samplePurposeByAlias = mapByAlias; }
Source:
protected static WebArchive createDeployment() { final Package testPackage = SecurityAPITestCase.class.getPackage(); return ShrinkWrap.create(WebArchive.class, SecurityAPITestCase.class.getSimpleName() + ".war") .addClasses(SecurityAPITestCase.class, AbstractElytronSetupTask.class, ServerSetup.class) .addClasses(TestAuthenticationMechanism.class, TestIdentityStore.class) .addClasses(TestServlet.class) .addClasses(WhoAmI.class, WhoAmIBean.class) .addAsWebInfResource(Utils.getJBossWebXmlAsset("SecurityAPI"), "jboss-web.xml") .addAsWebInfResource(testPackage, "jboss-ejb3.xml", "jboss-ejb3.xml") .addAsWebInfResource(testPackage, "beans.xml", "beans.xml"); }

Target:
protected static WebArchive createDeployment() { final Package testPackage = SecurityAPITestCase.class.getPackage(); return ShrinkWrap.create(WebArchive.class, SecurityAPITestCase.class.getSimpleName() + ".war") .addClasses(SecurityAPITestCase.class, AbstractElytronSetupTask.class, ServerSetup.class) .addClasses(TestAuthenticationMechanism.class, TestIdentityStore.class) .addClasses(TestServlet.class) .addClasses(WhoAmI.class, WhoAmIBean.class) .addAsWebInfResource(Utils.getJBossWebXmlAsset("SecurityAPI"), "jboss-web.xml") .addAsWebInfResource(testPackage, "jboss-ejb3.xml", "jboss-ejb3.xml") .addAsWebInfResource(testPackage, "beans.xml", "beans.xml") .addAsManifestResource(createPermissionsXmlAsset(new ElytronPermission("getSecurityDomain")), "permissions.xml"); }
Source:
public void addStressor(boolean failSilently) { int threadIndex = getNextThreadId(maxThreads); if (threadIndex < 0) { if (failSilently) { return; } reachedMax = true; log.warnf("Attempt to create more than %d threads!", maxThreads); Utils.threadDump(); return; } if (isSteadyState()) { if (failSilently) { return; } log.error("Creating new thread during steady-state!"); Utils.threadDump(); } waitingThreads.incrementAndGet(); Stressor stressor = new Stressor(threadIndex, this, logTransactionExceptions); synchronized (this) { if (!finished) { stressors.add(stressor); } } log.infof("Created stressor %s", stressor.getName()); stressor.start(); }

Target:
public void addStressor(boolean failSilently) { int threadIndex = getNextThreadId(maxThreads); if (threadIndex < 0) { if (failSilently) { return; } reachedMax = true; log.warnf("Attempt to create more than %d threads!", maxThreads); Utils.threadDump(); return; } if (isSteadyState()) { if (failSilently) { return; } log.error("Creating new thread during steady-state!"); Utils.threadDump(); } waitingThreads.incrementAndGet(); Stressor stressor = new Stressor(threadIndex, this, true, logTransactionExceptions); synchronized (this) { if (!finished) { stressors.add(stressor); } } log.infof("Created stressor %s", stressor.getName()); stressor.start(); }
Source:
public Map<String, Model> filterDefinitions(SwaggerSpecFilter filter, Map<String, Model> definitions, Map<String, List<String>> params, Map<String, String> cookies, Map<String, List<String>> headers) { if (definitions == null) { return null; } Map<String, Model> clonedDefinitions = new LinkedHashMap<String, Model>(); for (String key : definitions.keySet()) { Model definition = definitions.get(key); Map<String, Property> clonedProperties = new LinkedHashMap<String, Property>(); if (definition.getProperties() != null) { for (String propName : definition.getProperties().keySet()) { Property property = definition.getProperties().get(propName); if (property != null) { boolean shouldInclude = filter.isPropertyAllowed(definition, property, propName, params, cookies, headers); if (shouldInclude) { clonedProperties.put(propName, property); } } } } Model clonedModel = (Model) definition.clone(); if (clonedModel.getProperties() != null) clonedModel.getProperties().clear(); clonedModel.setProperties(clonedProperties); clonedDefinitions.put(key, clonedModel); } return clonedDefinitions; }

Target:
public Map<String, Model> filterDefinitions(SwaggerSpecFilter filter, Map<String, Model> definitions, Map<String, List<String>> params, Map<String, String> cookies, Map<String, List<String>> headers) { if (definitions == null) { return null; } Map<String, Model> clonedDefinitions = new LinkedHashMap<String, Model>(); for (String key : definitions.keySet()) { Model definition = definitions.get(key); Map<String, Property> clonedProperties = new LinkedHashMap<String, Property>(); if (definition.getProperties() != null) { for (String propName : definition.getProperties().keySet()) { Property property = definition.getProperties().get(propName); if (property != null) { boolean shouldInclude = filter.isPropertyAllowed(definition, property, propName, params, cookies, headers); if (shouldInclude) { clonedProperties.put(propName, property); } } } } Model clonedModel = (Model) definition.clone(); if (clonedModel.getProperties() != null) { clonedModel.getProperties().clear(); } clonedModel.setProperties(clonedProperties); clonedDefinitions.put(key, clonedModel); } return clonedDefinitions; }
Source:
public void execute(String[] args, ConsoleReader reader) throws Exception { boolean provideDescription = false; if (args.length == 3) { if (args[2].equals("--with-description")) { provideDescription = true; } else { throw new CliException("Invalid parameter " + args[2]); } } try (AppPackage ap = newAppPackageInstance(new File(expandFileName(args[1], true)))) { JSONSerializationProvider jomp = new JSONSerializationProvider(); jomp.addSerializer(PropertyInfo.class, new AppPackage.PropertyInfoSerializer(provideDescription)); JSONObject apInfo = new JSONObject(jomp.getContext(null).writeValueAsString(ap)); apInfo.remove("name"); printJson(apInfo); } }

Target:
public void execute(String[] args, ConsoleReader reader) throws Exception { String[] tmpArgs = new String[args.length - 2]; System.arraycopy(args, 2, tmpArgs, 0, args.length - 2); GetAppPackageInfoCommandLineInfo commandLineInfo = getGetAppPackageInfoCommandLineInfo(tmpArgs); try (AppPackage ap = newAppPackageInstance(new File(expandFileName(args[1], true)))) { JSONSerializationProvider jomp = new JSONSerializationProvider(); jomp.addSerializer(PropertyInfo.class, new AppPackage.PropertyInfoSerializer(commandLineInfo.provideDescription)); JSONObject apInfo = new JSONObject(jomp.getContext(null).writeValueAsString(ap)); apInfo.remove("name"); printJson(apInfo); } }
Source:
public long deleteHorizonMs() { if (isDeleteHorizonSet()) { return super.loadFullBatch().deleteHorizonMs(); } return RecordBatch.NO_TIMESTAMP; }

Target:
public long deleteHorizonMs() { if (deleteHorizonSet()) return super.loadBatchHeader().deleteHorizonMs(); return RecordBatch.NO_TIMESTAMP; }
Source:
public String getMessage() { return format("line %s:%s: %s", getLineNumber(), getColumnNumber(), getWarning()); }

Target:
public String getMessage() { return format("lineNumber %s:%s: %s", lineNumber, columnNumber, getWarning()); }
Source:
private boolean finishPacketRecovery(FlexFec03Packet fecPacket, RawPacket recoveredPacket) { recoveredPacket.getBuffer()[0] |= 0x80; recoveredPacket.getBuffer()[0] &= 0xbf; int length = RTPUtils.readUint16AsInt(recoveredPacket.getBuffer(), 2); if (length > recoveredPacket.getBuffer().length) { logger.error("Length field of recovered packet is larger" + " than its buffer"); return false; } recoveredPacket.setLength(length + RawPacket.FIXED_HEADER_SIZE); RTPUtils.writeShort(recoveredPacket.getBuffer(), 2, (short)missingSequenceNumber); RTPUtils.writeInt(recoveredPacket.getBuffer(), 8, (int)fecPacket.getProtectedSsrc()); return true; }

Target:
private boolean finishPacketRecovery(FlexFec03Packet fecPacket, RawPacket recoveredPacket) { recoveredPacket.getBuffer()[0] |= 0x80; recoveredPacket.getBuffer()[0] &= 0xbf; int length = RTPUtils.readUint16AsInt(recoveredPacket.getBuffer(), 2); int lengthWithFixedHeader = length + RawPacket.FIXED_HEADER_SIZE; if (lengthWithFixedHeader > recoveredPacket.getBuffer().length) { logger.error("Length field of recovered packet is larger" + " than its buffer"); return false; } recoveredPacket.setLength(lengthWithFixedHeader); recoveredPacket.setSequenceNumber(missingSequenceNumber); recoveredPacket.setSSRC((int)fecPacket.getProtectedSsrc()); return true; }
Source:
public void testSTCentroid() throws Exception { assertQuery("select st_as_text(st_centroid(st_geometry_from_text('polygon ((1 1, 1 4, 4 4, 4 1))')))", "select 'POINT (2.5 2.5)'"); }

Target:
public void testSTCentroid() throws Exception { assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('LINESTRING EMPTY')))", VARCHAR, "POINT EMPTY"); assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('POINT (3 5)')))", VARCHAR, "POINT (3 5)"); assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('MULTIPOINT (1 2, 2 4, 3 6, 4 8)')))", VARCHAR, "POINT (2.5 5)"); assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('LINESTRING (1 1, 2 2, 3 3)')))", VARCHAR, "POINT (2 2)"); assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('MULTILINESTRING ((1 1, 5 1), (2 4, 4 4))')))", VARCHAR, "POINT (3 2)"); assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('POLYGON ((1 1, 1 4, 4 4, 4 1))')))", VARCHAR, "POINT (2.5 2.5)"); assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('POLYGON ((1 1, 5 1, 3 4))')))", VARCHAR, "POINT (3 2)"); assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('MULTIPOLYGON (((1 1, 1 3, 3 3, 3 1)), ((2 4, 2 6, 6 6, 6 4)))')))", VARCHAR, "POINT (3.3333333333333335 4)"); assertFunction("ST_AsText(ST_Centroid(ST_GeometryFromText('POLYGON ((0 0, 0 5, 5 5, 5 0, 0 0), (1 1, 1 2, 2 2, 2 1, 1 1))')))", VARCHAR, "POINT (2.5416666666666665 2.5416666666666665)"); }
Source:
public IFileRevision[] getTargets(final IFileRevision ifr) { final IFileRevision[] allRevisions = getFileRevisions(); final List<IFileRevision> descendants = new ArrayList<IFileRevision>(); for (IFileRevision candidate : allRevisions) { if (candidate.getTimestamp() < ifr.getTimestamp()) descendants.add(candidate); } return descendants.toArray(new IFileRevision[descendants.size()]); }

Target:
public IFileRevision[] getTargets(final IFileRevision ifr) { final IFileRevision[] allRevisions = getFileRevisions(); final List<IFileRevision> descendants = new ArrayList<IFileRevision>(); if (!(ifr instanceof CommitFileRevision)) { for (IFileRevision candidate : allRevisions) { if (candidate.getTimestamp() < ifr.getTimestamp()) descendants.add(candidate); } } else { final CommitFileRevision rev = (CommitFileRevision) ifr; final RevCommit rc = rev.getRevCommit(); for (IFileRevision candidate : allRevisions) { if (candidate instanceof CommitFileRevision) { final RevCommit candidateCommit = ((CommitFileRevision) candidate) .getRevCommit(); if (candidateCommit.getCommitTime() < rc.getCommitTime()) descendants.add(candidate); } } } return descendants.toArray(new IFileRevision[descendants.size()]); }
Source:
private KubernetesServiceAddressResolver prepareResolver(boolean includeNotReadyAddresses) throws IOException { File account = File.createTempFile("kubernetes-test-account", ""); new FileWriter(account).write("account-token"); String accountFile = account.getAbsolutePath(); KubernetesConnectionConfiguration cfg = new KubernetesConnectionConfiguration(); cfg.setNamespace(namespace); cfg.setServiceName(service); cfg.setMasterUrl("https://localhost:" + mockServer.getLocalPort()); cfg.setAccountToken(accountFile); cfg.setIncludeNotReadyAddresses(includeNotReadyAddresses); return new KubernetesServiceAddressResolver(cfg); }

Target:
private KubernetesServiceAddressResolver prepareResolver(boolean includeNotReadyAddresses) throws IOException { File account = File.createTempFile("kubernetes-test-account", ""); FileWriter fw = new FileWriter(account); fw.write("account-token"); fw.close(); String accountFile = account.getAbsolutePath(); KubernetesConnectionConfiguration cfg = new KubernetesConnectionConfiguration(); cfg.setNamespace(namespace); cfg.setServiceName(service); cfg.setMasterUrl("https://localhost:" + mockServer.getLocalPort()); cfg.setAccountToken(accountFile); cfg.setIncludeNotReadyAddresses(includeNotReadyAddresses); return new KubernetesServiceAddressResolver(cfg); }
Source:
public void invoke(final A event) { Runnable r = () -> { ClassLoader contextClassLoader = null; Transaction transaction = suspendIfNeeded(); if (classLoader.get() != null) { contextClassLoader = SecurityActions.setContextClassLoader(classLoader.get()); } try { if (subject != null) { try { Security.doAs(subject, (PrivilegedExceptionAction<Void>) () -> { if (trace) { log.tracef("Invoking listener: %s passing event %s using subject", target, event); } method.invoke(target, event); return null; }); } catch (PrivilegedActionException e) { Throwable cause = e.getCause(); if (cause instanceof InvocationTargetException) { throw (InvocationTargetException)cause; } else if (cause instanceof IllegalAccessException) { throw (IllegalAccessException)cause; } else { throw new InvocationTargetException(cause); } } } else { if (trace) { log.tracef("Invoking listener: %s passing event %s", target, event); } method.invoke(target, event); } } catch (InvocationTargetException exception) { Throwable cause = getRealException(exception); if (sync) { throw getLog().exceptionInvokingListener( cause.getClass().getName(), method, target, cause); } else { getLog().unableToInvokeListenerMethod(method, target, cause); } } catch (IllegalAccessException exception) { getLog().unableToInvokeListenerMethodAndRemoveListener(method, target, exception); removeListener(target); } finally { if (classLoader.get() != null) { SecurityActions.setContextClassLoader(contextClassLoader); } resumeIfNeeded(transaction); } }; if (sync) syncProcessor.execute(r); else asyncProcessor.execute(r); }

Target:
public void invoke(final A event) { Runnable r = () -> { ClassLoader contextClassLoader = null; Transaction transaction = suspendIfNeeded(); if (classLoader.get() != null) { contextClassLoader = SecurityActions.setContextClassLoader(classLoader.get()); } try { if (subject != null) { try { Security.doAs(subject, (PrivilegedExceptionAction<Void>) () -> { getLog().tracef("Invoking listener: %s passing event %s using subject", target, event); method.invoke(target, event); return null; }); } catch (PrivilegedActionException e) { Throwable cause = e.getCause(); if (cause instanceof InvocationTargetException) { throw (InvocationTargetException)cause; } else if (cause instanceof IllegalAccessException) { throw (IllegalAccessException)cause; } else { throw new InvocationTargetException(cause); } } } else { getLog().tracef("Invoking listener: %s passing event %s", target, event); method.invoke(target, event); } } catch (InvocationTargetException exception) { Throwable cause = getRealException(exception); if (sync) { throw getLog().exceptionInvokingListener( cause.getClass().getName(), method, target, cause); } else { getLog().unableToInvokeListenerMethod(method, target, cause); } } catch (IllegalAccessException exception) { getLog().unableToInvokeListenerMethodAndRemoveListener(method, target, exception); removeListener(target); } finally { if (classLoader.get() != null) { SecurityActions.setContextClassLoader(contextClassLoader); } resumeIfNeeded(transaction); } }; if (sync) syncProcessor.execute(r); else asyncProcessor.execute(r); }
Source:
private void checkActivityRecordValidity() throws ServerException { for (String runningWsId : workspaceRuntimes.getRunning()) { WorkspaceActivity activity = activityDao.findActivity(runningWsId); long idleTimeout = workspaceActivityManager.getIdleTimeout(runningWsId); if (activity == null) { createMissingActivityRecord(runningWsId, idleTimeout); } else { rectifyCreatedTime(activity); long now = clock.millis(); Long lastKnownActivity = newestActivity(activity); boolean noLastRunningTime = rectifyLastRunningTime(activity, now, lastKnownActivity); rectifyExpirationTime(activity, now, noLastRunningTime, lastKnownActivity, idleTimeout); } } }

Target:
private void checkActivityRecordValidity() throws ServerException { for (String runningWsId : workspaceRuntimes.getRunning()) { WorkspaceActivity activity = activityDao.findActivity(runningWsId); long idleTimeout = workspaceActivityManager.getIdleTimeout(runningWsId); if (activity == null) { createMissingActivityRecord(runningWsId, idleTimeout); } else { rectifyCreatedTime(activity); long now = clock.millis(); Long latestActivityTime = getLatestActivityTime(activity); boolean noLastRunningTime = rectifyLastRunningTime(activity, now, latestActivityTime); rectifyExpirationTime(activity, now, noLastRunningTime, latestActivityTime, idleTimeout); } } }
Source:
private static boolean isSuccess(int responseCode) { int startingNumber = (responseCode / 100); return startingNumber == SUCCESS; }

Target:
private static boolean isSuccess(int responseCode) { return (responseCode >= 200 && responseCode < 300); }
Source:
public Lot createLotForAdd( final Integer gid, final Integer locationId, final Integer scaleId, final String comment, final Integer userId, final CropType cropType) throws MiddlewareQueryException { final Lot lot = new Lot(null, userId, EntityType.GERMPLSM.name(), gid, locationId, scaleId, LotStatus.ACTIVE.getIntValue(), LotBuilder.LOT_NOT_DERIVED_FROM_ANOTHER, comment); this.lotIDGenerator = new LotIDGeneratorImpl(); this.lotIDGenerator.generateLotIds(cropType, Lists.newArrayList(lot)); return lot; }

Target:
public Lot createLotForAdd( final Integer gid, final Integer locationId, final Integer scaleId, final String comment, final Integer userId, final CropType cropType) throws MiddlewareQueryException { final Lot lot = new Lot(null, userId, EntityType.GERMPLSM.name(), gid, locationId, scaleId, LotStatus.ACTIVE.getIntValue(), LotBuilder.LOT_NOT_DERIVED_FROM_ANOTHER, comment); this.getInventoryDataManager().generateLotIds(cropType, Lists.newArrayList(lot)); return lot; }
Source:
protected CoapResponse doInBackground(String... args) { CoapClient client = new CoapClient(args[0]); if (isSecure) { CoapEndpoint.CoapEndpointBuilder endpointBuilder = new CoapEndpoint.CoapEndpointBuilder(); DtlsConnectorConfig.Builder dtlsConfig = new DtlsConnectorConfig.Builder(); dtlsConfig.setClientOnly(); ConfigureDtls.loadCredentials(getApplicationContext(), dtlsConfig, CLIENT_NAME); DTLSConnector dtlsConnector = new DTLSConnector(dtlsConfig.build()); endpointBuilder.setConnector(dtlsConnector); client.setEndpoint(endpointBuilder.build()); } return client.get(); }

Target:
protected CoapResponse doInBackground(String... args) { CoapClient client = new CoapClient(args[0]); return client.get(); }
Source:
public static void removeDiskFromVm(Guid vmGuid, Disk disk) { DbFacade.getInstance().getVmDeviceDAO().remove(new VmDeviceId(disk.getId(), vmGuid)); }

Target:
public static void removeDiskFromVm(Guid vmGuid, Disk disk) { DbFacade.getInstance().getVmDeviceDAO().remove(new VmDeviceId(disk.getId(), vmGuid)); DbFacade.getInstance().getDiskDao().remove(disk.getId()); }
Source:
public void gracefullyHandlesBrokenBack() throws Exception { secure(new TkFailure("Jeffrey Lebowski")).exec( new FtRemote.Script() { @Override public void exec(final URI home) throws IOException { new JdkRequest(home) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_INTERNAL_ERROR) .assertBody(Matchers.containsString("Lebowski")); } } ); }

Target:
public void gracefullyHandlesBrokenBack() throws Exception { FtSecureTest.secure(new TkFailure("Jeffrey Lebowski")).exec( new FtRemote.Script() { @Override public void exec(final URI home) throws IOException { new JdkRequest(home) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_INTERNAL_ERROR) .assertBody(Matchers.containsString("Lebowski")); } } ); }
Source:
public ImmutableSpongeBreathingData(int maxAir, int remainingAir) { super(ImmutableBreathingData.class); this.maxAir = maxAir; this.remainingAir = remainingAir; remainingAirValue = new ImmutableSpongeBoundedValue<>(Keys.REMAINING_AIR, this.remainingAir, this.maxAir, ComparatorUtil.intComparator(), -20, this.maxAir); maxAirValue = new ImmutableSpongeBoundedValue<>(Keys.MAX_AIR, this.maxAir, 300, ComparatorUtil.intComparator(), 0, Integer.MAX_VALUE); registerGetters(); }

Target:
public ImmutableSpongeBreathingData(int maxAir, int remainingAir) { super(ImmutableBreathingData.class); this.maxAir = maxAir; this.remainingAir = remainingAir; remainingAirValue = SpongeValueBuilder.boundedBuilder(Keys.REMAINING_AIR) .actualValue(remainingAir) .defaultValue(this.maxAir) .minimum(-20) .maximum(this.maxAir) .build() .asImmutable(); maxAirValue = SpongeValueBuilder.boundedBuilder(Keys.MAX_AIR) .actualValue(this.maxAir) .defaultValue(300) .minimum(0) .maximum(Integer.MAX_VALUE) .build() .asImmutable(); registerGetters(); }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { final RebaseOperation rebase = createRebaseOperation(event); execute(rebase); return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { Repository repository = getRepository(event); execute(repository); return null; }
Source:
public static CrateInstances fromStream(byte[] value) throws IOException { if (value.length == 0) { return new CrateInstances(); } ByteArrayInputStream in = new ByteArrayInputStream(value); try (ObjectInputStream objectInputStream = new ObjectInputStream(in)) { CrateInstances crateInstances = (CrateInstances) objectInputStream.readObject(); crateInstances.hosts = null; return crateInstances; } catch (ClassNotFoundException e) { LOGGER.error("Failed to deserialize CrateInstances: {}", e.getMessage()); e.printStackTrace(); } return null; }

Target:
public static CrateInstances fromStream(byte[] value) throws IOException { if (value.length == 0) { return new CrateInstances(); } ByteArrayInputStream in = new ByteArrayInputStream(value); try (ObjectInputStream objectInputStream = new ObjectInputStream(in)) { CrateInstances crateInstances = (CrateInstances) objectInputStream.readObject(); crateInstances.hosts = null; return crateInstances; } catch (ClassNotFoundException e) { LOGGER.error("Failed to deserialize CrateInstances:", e); e.printStackTrace(); } return null; }
Source:
private void showFinalSelection(UIContextImpl context) { UISelection<?> selection = context.getSelection(); if (!selection.isEmpty()) { selectResourceFor(selection.get()); } }

Target:
private void showFinalSelection(UIContextImpl context) { UISelection<?> selection = context.getSelection(); if (selection != null && !selection.isEmpty()) { selectResourceFor(selection.get()); } }
Source:
public void visitLiteral(LiteralTree tree) { String literal = tree.value().toLowerCase(Locale.ROOT); if (literal.contains(OPENSSL_DES)) { context().newIssue(this, tree, MESSAGE); } super.visitLiteral(tree); }

Target:
public void visitLiteral(LiteralTree tree) { String literal = trimQuotes(tree.value().toLowerCase(Locale.ROOT)); if (literal.startsWith(OPENSSL_DES)) { context().newIssue(this, tree, MESSAGE); } super.visitLiteral(tree); }
Source:
public void setFontFamily(@NonNull String fontFamily) { if (!fontFamily.equals(Prefs.getFontFamily())) { Prefs.setFontFamily(fontFamily); bus.post(new ThemeChangeEvent()); } }

Target:
public void setFontFamily(@NonNull String fontFamily) { if (!fontFamily.equals(Prefs.getFontFamily())) { Prefs.setFontFamily(fontFamily); bus.post(new ThemeFontChangeEvent()); } }
Source:
private String getSuggestedBranchName() { if (fullBranch != null) { String branchName = Repository.shortenRefName(fullBranch); StoredConfig config = repository.getConfig(); BranchConfig branchConfig = new BranchConfig(config, branchName); String merge = branchConfig.getMerge(); if (!branchConfig.isRemoteLocal() && merge != null && merge.startsWith(Constants.R_HEADS)) { return Repository.shortenRefName(merge); } else if (merge == null) { if (fullBranch != null && fullBranch.startsWith(Constants.R_HEADS)) { return branchName; } } } return ""; }

Target:
private String getSuggestedBranchName() { if (fullBranch != null) { String branchName = Repository.shortenRefName(fullBranch); StoredConfig config = repository.getConfig(); BranchConfig branchConfig = new BranchConfig(config, branchName); String merge = branchConfig.getMerge(); if (!branchConfig.isRemoteLocal() && merge != null && merge.startsWith(Constants.R_HEADS)) { return Repository.shortenRefName(merge); } else if (merge == null && fullBranch.startsWith(Constants.R_HEADS)) { return branchName; } } return ""; }
Source:
public boolean isDecorationReady(Object element, IDecorationContext context) { if (isUpdateJobRunning.get()) { return internalGetResult(element, context) != null; } return false; }

Target:
public boolean isDecorationReady(Object element, IDecorationContext context) { if (isUpdateJobRunning) { return internalGetResult(element, context) != null; } return false; }
Source:
public Iterable<Signed<Timestamp>> asChangeSequence() { return Lists.newArrayList(this.getSigned(0)); }

Target:
public Iterable<Signed<Timestamp>> asChangeSequence() { return Collections.singletonList(this.getSigned(0)); }
Source:
private void doClose() { if (CollectionUtils.isNotEmpty(tasks)) { for (Timeout timeout : tasks) { timeout.cancel(); } tasks.clear(); } }

Target:
private void doClose() { heartBeatTimerTask.cancel(); reconnectTimerTask.cancel(); }
Source:
public boolean useTls() { return StringUtils.startsWithIgnoreCase( AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(SOLR_HTTP_URL)), "https"); }

Target:
private boolean useTls() { return StringUtils.startsWithIgnoreCase( AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(SOLR_HTTP_URL)), "https"); }
Source:
public void updateModel(final OperationContext context, ModelNode model, AttributeDefinition attributeDefinition, ModelNode attribute) throws OperationFailedException { String key = KEY.resolveModelAttribute(context, model).asString(); ModelNode value = VALUE.resolveModelAttribute(context, model); attribute.get(key).set(value); }

Target:
void updateModel(final OperationContext context, ModelNode model, AttributeDefinition attributeDefinition, ModelNode attribute) throws OperationFailedException { String key = KEY.resolveModelAttribute(context, model).asString(); ModelNode value = VALUE.resolveModelAttribute(context, model); attribute.get(key).set(value); }
Source:
public boolean equals(Object obj) { if (obj instanceof SecureStoreData) { SecureStoreData o = (SecureStoreData) obj; return Objects.equal(storeName, o.storeName); } return equals(obj); }

Target:
public boolean equals(Object obj) { if (obj instanceof SecureStoreData) { SecureStoreData o = (SecureStoreData) obj; return storeName.equals(o.storeName); } return super.equals(obj); }