auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public String getText(Object element) { String str = ""; if (element instanceof SpecfileSection) { SpecfileSection specfileSection = (SpecfileSection) element; str = specfileSection.toString(); } else if (element instanceof Specfile) { str = ((Specfile) element).getName(); } else if (element instanceof SpecfilePackageContainer) { str = Messages.SpecfileLabelProvider_0; } else if (element instanceof SpecfilePreamble){ str = Messages.SpecfileLabelProvider_1; } else if (element instanceof SpecfileElement) { SpecfileElement specfileElement = (SpecfileElement) element; str = specfileElement.getName(); } else if (element instanceof String) { str = (String) element; } else if (element instanceof SpecfilePackage) { str = ((SpecfilePackage) element).getName(); } <START> return str.trim(); <END> }</code><technical_language>I mind a change if scl_prefix filtered show in outline. This is reason eval added</technical_language>

Target:
public String getText(Object element) { String str = ""; if (element instanceof SpecfileSection) { SpecfileSection specfileSection = (SpecfileSection) element; str = specfileSection.toString(); } else if (element instanceof Specfile) { str = ((Specfile) element).getName(); } else if (element instanceof SpecfilePackageContainer) { str = Messages.SpecfileLabelProvider_0; } else if (element instanceof SpecfilePreamble){ str = Messages.SpecfileLabelProvider_1; } else if (element instanceof SpecfileElement) { SpecfileElement specfileElement = (SpecfileElement) element; str = specfileElement.getName(); } else if (element instanceof String) { str = (String) element; } else if (element instanceof SpecfilePackage) { str = ((SpecfilePackage) element).getName(); } return filterMacros(str.trim()); }
Source:
<code>public ServiceDefinition introspectServiceInterface(Class<?> serviceInterface) { Service serviceAnnotation = serviceInterface.getAnnotation(Service.class); checkArgument(serviceAnnotation != null, "Not a service interface: %s", serviceInterface); String serviceName = resolveServiceName(serviceInterface, serviceAnnotation); Map<String, Method> methods = new HashMap<>(); <START> for (Method method : serviceInterface.getMethods()) { <END> if (method.isAnnotationPresent(ServiceMethod.class)) { ServiceMethod methodAnnotation = method.getAnnotation(ServiceMethod.class); String methodName = resolveMethodName(method, methodAnnotation); if (methods.containsKey(methodName)) { throw new IllegalStateException("Service method with name '" + methodName + "' already exists"); } methods.put(methodName, method); } } ServiceDefinition serviceDefinition = new ServiceDefinition(serviceInterface, serviceName, Collections.unmodifiableMap(methods)); return serviceDefinition; }</code><technical_language>java // Method name Map<String, Method> methods = Arrays.stream(serviceInterface.getMethods()) .filter(method -> method.isAnnotationPresent(ServiceMethod.class)) .collect(Collectors.toMap(method -> { ServiceMethod methodAnnotation = method.getAnnotation(ServiceMethod.class); return resolveMethodName(method, methodAnnotation); }, Function.identity()));</technical_language>

Target:
public ServiceDefinition introspectServiceInterface(Class<?> serviceInterface) { Service serviceAnnotation = serviceInterface.getAnnotation(Service.class); checkArgument(serviceAnnotation != null, "Not a service interface: %s", serviceInterface); String serviceName = resolveServiceName(serviceInterface, serviceAnnotation); Map<String, Method> methods = Arrays.stream(serviceInterface.getMethods()) .filter(method -> method.isAnnotationPresent(ServiceMethod.class)) .collect(Collectors.toMap(method -> { ServiceMethod methodAnnotation = method.getAnnotation(ServiceMethod.class); return resolveMethodName(method, methodAnnotation); }, Function.identity())); return new ServiceDefinition(serviceInterface, serviceName, Collections.unmodifiableMap(methods)); }
Source:
<code>public SignatureKeyManager( @Named("che.auth.signature_key_size") int keySize, @Named("che.auth.signature_key_algorithm") String algorithm, EventService eventService, SignatureKeyDao signatureKeyDao) { this.keySize = keySize; this.algorithm = algorithm; this.eventService = eventService; this.signatureKeyDao = signatureKeyDao; this.workspaceEventsSubscriber = new EventSubscriber<WorkspaceStatusEvent>() { @Override public void onEvent(WorkspaceStatusEvent event) { switch (event.getStatus()) { case STOPPED: try { cachedPair.remove(event.getWorkspaceId()); signatureKeyDao.remove(event.getWorkspaceId()); } catch (ServerException e) { <START> LOG.error(e.getLocalizedMessage(), e); <END> } break; default: } } }; }</code><technical_language>Please add context message here. localized message</technical_language>

Target:
public SignatureKeyManager( @Named("che.auth.signature_key_size") int keySize, @Named("che.auth.signature_key_algorithm") String algorithm, EventService eventService, SignatureKeyDao signatureKeyDao) { this.keySize = keySize; this.algorithm = algorithm; this.eventService = eventService; this.signatureKeyDao = signatureKeyDao; this.cachedPair = CacheBuilder.newBuilder() .maximumSize(100) .expireAfterAccess(2, TimeUnit.HOURS) .build( new CacheLoader<String, KeyPair>() { @Override public KeyPair load(String key) throws Exception { return loadKeyPair(key); } }); this.workspaceEventsSubscriber = new EventSubscriber<WorkspaceStatusEvent>() { @Override public void onEvent(WorkspaceStatusEvent event) { if (event.getStatus() == STOPPED) { removeKeyPair(event.getWorkspaceId()); } } }; }
Source:
<code>public static void updateActivity(Channel channel, Activity activity, String channelId) throws ActivitySerializerException { try { activity.setProvider(getProvider()); <START> Actor actor = new Actor(); <END> activity.setVerb("post"); actor.setId("id:youtube:"+channel.getId()); actor.setSummary(channel.getSnippet().getDescription()); actor.setDisplayName(channel.getSnippet().getTitle()); Image image = new Image(); image.setUrl(channel.getSnippet().getThumbnails().getHigh().getUrl()); actor.setImage(image); actor.setUrl("<LINK_0>" + channel.getId()); Map<String, Object> actorExtensions = Maps.newHashMap(); actorExtensions.put("followers", channel.getStatistics().getSubscriberCount()); actorExtensions.put("posts", channel.getStatistics().getVideoCount()); actor.setAdditionalProperty("extensions", actorExtensions); activity.setActor(actor); Map<String, Object> extensions = Maps.newHashMap(); extensions.put("youtube", channel); activity.setAdditionalProperty("extensions", extensions); } catch (Throwable t) { throw new ActivitySerializerException(t); } }</code><technical_language>move this actor creation a separate method</technical_language>

Target:
public static void updateActivity(Channel channel, Activity activity, String channelId) throws ActivitySerializerException { try { activity.setProvider(getProvider()); activity.setVerb("post"); activity.setActor(createActorForChannel(channel)); Map<String, Object> extensions = Maps.newHashMap(); extensions.put("youtube", channel); activity.setAdditionalProperty("extensions", extensions); } catch (Throwable t) { throw new ActivitySerializerException(t); } }
Source:
<code>public String getTranslatedFamilyName() { String[] transNames = familyName.split("/"); if (transNames != null && transNames.length > 0) { IComponentsFactory factory = ComponentsFactoryProvider.getInstance(); String translated = factory.getFamilyTranslation(this, "FAMILY." + transNames[0].replace(" ", "_")); <START> translatedFamilyName = translated + "/DB Common"; <END> } return translatedFamilyName; }</code><technical_language>Please add hard code this</technical_language>

Target:
public String getTranslatedFamilyName() { String[] transNames = familyName.split("/"); IComponentsFactory factory = ComponentsFactoryProvider.getInstance(); if (transNames != null && transNames.length > 0) { StringBuffer stringBuffer = new StringBuffer(); for (String toTranslate : transNames) { String translated = factory.getFamilyTranslation(this, "FAMILY." + toTranslate.replace(" ", "_")); if (translated.startsWith("!!")) { if (stringBuffer.length() > 0) { stringBuffer.append("/"); } stringBuffer.append(toTranslate); } else { if (stringBuffer.length() > 0) { stringBuffer.append("/"); } stringBuffer.append(translated); } } translatedFamilyName = stringBuffer.toString(); } return translatedFamilyName; }
Source:
<code>private static int upgradeTextBoxProperties(Map<String, JSONValue> componentProperties, int srcCompVersion) { if (srcCompVersion < 2) { srcCompVersion = 2; } if (srcCompVersion < 3) { handlePropertyRename(componentProperties, "Alignment", "TextAlignment"); srcCompVersion = 3; } if (srcCompVersion < 4) { componentProperties.put("MultiLine", new ClientJsonString("True")); srcCompVersion = 4; } if (srcCompVersion < 5) { srcCompVersion = 5; } <START> if (scrCompVersion < 6) { <END> srcCompVersion = 6; } return srcCompVersion; }</code><technical_language>Compile failed. This is a typo srcCompVersion</technical_language>

Target:
private static int upgradeTextBoxProperties(Map<String, JSONValue> componentProperties, int srcCompVersion) { if (srcCompVersion < 2) { srcCompVersion = 2; } if (srcCompVersion < 3) { handlePropertyRename(componentProperties, "Alignment", "TextAlignment"); srcCompVersion = 3; } if (srcCompVersion < 4) { componentProperties.put("MultiLine", new ClientJsonString("True")); srcCompVersion = 4; } if (srcCompVersion < 5) { srcCompVersion = 5; } if (srcCompVersion < 6) { srcCompVersion = 6; } return srcCompVersion; }
Source:
<code>public Laplace(double mean, double diversity) { fixedMean = true; <START> setMean(new Double(mean)); <END> fixedDiversity = true; setDiversity(new Double(diversity)); }</code><technical_language>Deleted</technical_language>

Target:
public Laplace(double mean, double diversity) { expectMeanAsArg = false; setMean(mean); expectDiversityAsArg = false; setDiversity(diversity); }
Source:
<code>@Test public void completableSuccess200() { server.enqueue(new MockResponse().setBody("Hi")); try { service.completable().await(); assertThat(true); } catch (RuntimeException e) { fail(); <START> } <END> }</code><technical_language>delete try/catch assertThat, add</technical_language>

Target:
@Test public void completableSuccess200() { server.enqueue(new MockResponse().setBody("Hi")); service.completable().await(); }
Source:
<code>public void runAndCollect(Runnable runnable) { IObservable[] collected = ObservableTracker.runAndCollect(runnable); for (IObservable <START> element : <END> collected) addObservable(element); }</code><technical_language>rename 'observable'</technical_language>

Target:
public void runAndCollect(Runnable runnable) { IObservable[] collected = ObservableTracker.runAndCollect(runnable); for (IObservable observable : collected) addObservable(observable); }
Source:
<code>public static Builder builder() { return new Builder() { List<Destination> fmb = new ArrayList<>(); @Override public Builder loadFileTo(String fileName, RangeType rangeType, Text startRow, Text endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder loadFileTo(String fileName, RangeType rangeType, byte[] startRow, byte[] endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder loadFileTo(String fileName, RangeType rangeType, CharSequence startRow, CharSequence endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder addPlan(LoadPlan plan) { fmb.addAll(plan.getDestinations()); return this; } @Override public LoadPlan build() { <START> return new LoadPlan(Collections.unmodifiableList(fmb)); <END> } }; }</code><technical_language>This behaviors differs user call addPlan calling build mutate list</technical_language>

Target:
public static Builder builder() { return new Builder() { ImmutableList.Builder<Destination> fmb = ImmutableList.builder(); @Override public Builder loadFileTo(String fileName, RangeType rangeType, Text startRow, Text endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder loadFileTo(String fileName, RangeType rangeType, byte[] startRow, byte[] endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder loadFileTo(String fileName, RangeType rangeType, CharSequence startRow, CharSequence endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder addPlan(LoadPlan plan) { fmb.addAll(plan.getDestinations()); return this; } @Override public LoadPlan build() { return new LoadPlan(fmb.build()); } }; }
Source:
<code>public IndexDiffData(IndexDiff indexDiff) { added.addAll(indexDiff.getAdded()); changed.addAll(indexDiff.getChanged()); removed.addAll(indexDiff.getRemoved()); missing.addAll(indexDiff.getMissing()); modified.addAll(indexDiff.getModified()); untracked.addAll(indexDiff.getUntracked()); conflicts.addAll(indexDiff.getConflicting()); changedFileResources = null; <START> makeSetsUnmodifiable(); <END> }</code><technical_language>instead of this code call this(indexDiff, null, null); marking members final easy ;)</technical_language>

Target:
public IndexDiffData(IndexDiff indexDiff) { added = Collections.unmodifiableSet(new HashSet<String>(indexDiff .getAdded())); changed = Collections.unmodifiableSet(new HashSet<String>(indexDiff .getChanged())); removed = Collections.unmodifiableSet(new HashSet<String>(indexDiff .getRemoved())); missing = Collections.unmodifiableSet(new HashSet<String>(indexDiff .getMissing())); modified = Collections.unmodifiableSet(new HashSet<String>(indexDiff .getModified())); untracked = Collections.unmodifiableSet(new HashSet<String>(indexDiff .getUntracked())); conflicts = Collections.unmodifiableSet(new HashSet<String>(indexDiff .getConflicting())); changedFileResources = null; }
Source:
<code><START> public ExtendedInMemoryUserDetailsManager myUserDetailsService() { <END> ExtendedInMemoryUserDetailsManager extendedInMemoryUserDetailsManager = new ExtendedInMemoryUserDetailsManager(); List<GrantedAuthority> salaboyAuthorities = new ArrayList<>(); salaboyAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_USER")); salaboyAuthorities.add(new SimpleGrantedAuthority("GROUP_activitiTeam")); salaboyAuthorities.add(new SimpleGrantedAuthority("GROUP_developers")); extendedInMemoryUserDetailsManager.createUser(new User("salaboy", "password", salaboyAuthorities)); List<GrantedAuthority> adminAuthorities = new ArrayList<>(); adminAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_ADMIN")); extendedInMemoryUserDetailsManager.createUser(new User("admin", "password", adminAuthorities)); List<GrantedAuthority> garthAuthorities = new ArrayList<>(); garthAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_USER")); garthAuthorities.add(new SimpleGrantedAuthority("GROUP_doctor")); extendedInMemoryUserDetailsManager.createUser(new User("garth", "password", garthAuthorities)); return extendedInMemoryUserDetailsManager; }</code><technical_language>@pancudaniel7 here, return type: UserDetailsService</technical_language>

Target:
public UserDetails myUserDetailsService() { ExtendedInMemoryUserDetailsManager extendedInMemoryUserDetailsManager = new ExtendedInMemoryUserDetailsManager(); List<GrantedAuthority> salaboyAuthorities = new ArrayList<>(); salaboyAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_USER")); salaboyAuthorities.add(new SimpleGrantedAuthority("GROUP_activitiTeam")); salaboyAuthorities.add(new SimpleGrantedAuthority("GROUP_developers")); extendedInMemoryUserDetailsManager.createUser(new User("salaboy", "password", salaboyAuthorities)); List<GrantedAuthority> adminAuthorities = new ArrayList<>(); adminAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_ADMIN")); extendedInMemoryUserDetailsManager.createUser(new User("admin", "password", adminAuthorities)); List<GrantedAuthority> garthAuthorities = new ArrayList<>(); garthAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_USER")); garthAuthorities.add(new SimpleGrantedAuthority("GROUP_doctor")); extendedInMemoryUserDetailsManager.createUser(new User("garth", "password", garthAuthorities)); return (UserDetails) extendedInMemoryUserDetailsManager; }
Source:
<code>private void serializeLocalBookieConfig(ServerConfiguration localBookieConfig, String fileName) throws IOException { File localBookiesConfigDir = new File(localBookieConfig.getLocalBookiesConfigDirName()); File localBookieConfFile = new File(localBookiesConfigDir, fileName); if (localBookieConfFile.exists() && !localBookieConfFile.delete()) { throw new IOException( "Unable to delete the existing LocalBookieConfigFile - " + localBookieConfFile.getAbsolutePath()); } if (!localBookieConfFile.createNewFile()) { throw new IOException("Unable to create new File - " + localBookieConfFile.getAbsolutePath()); } <START> PrintWriter writer = new PrintWriter(localBookieConfFile); <END> Iterator<String> keys = localBookieConfig.getKeys(); try { while (keys.hasNext()) { String key = keys.next().toString(); String[] values = localBookieConfig.getStringArray(key); StringBuilder concatenatedValue = new StringBuilder(values[0]); for (int i = 1; i < values.length; i++) { concatenatedValue.append("," + values[i]); } writer.println(key + "=" + concatenatedValue.toString()); } } finally { writer.flush(); writer.close(); } }</code><technical_language>setting file encoding, explicitly utf-8. Nit: try-with-resources block</technical_language>

Target:
private void serializeLocalBookieConfig(ServerConfiguration localBookieConfig, String fileName) throws IOException { File localBookieConfFile = new File(localBookiesConfigDir, fileName); if (localBookieConfFile.exists() && !localBookieConfFile.delete()) { throw new IOException( "Unable to delete the existing LocalBookieConfigFile - " + localBookieConfFile.getAbsolutePath()); } if (!localBookieConfFile.createNewFile()) { throw new IOException("Unable to create new File - " + localBookieConfFile.getAbsolutePath()); } Iterator<String> keys = localBookieConfig.getKeys(); try (PrintWriter writer = new PrintWriter(localBookieConfFile, "UTF-8")) { while (keys.hasNext()) { String key = keys.next().toString(); String[] values = localBookieConfig.getStringArray(key); StringBuilder concatenatedValue = new StringBuilder(values[0]); for (int i = 1; i < values.length; i++) { concatenatedValue.append("," + values[i]); } writer.println(key + "=" + concatenatedValue.toString()); } } }
Source:
<code>public SelfReferencingURLMapper(final String localFedoraServer, final MigrationIDMapper idMapper) { <START> this.contentPatterns = new ArrayList<Pattern>(); <END> this.contentPatterns.add(parsePattern(OLD_DS_CONTENT_URL_PATTERN, localFedoraServer)); this.contentPatterns.add(parsePattern(NEW_DS_CONTENT_URL_PATTERN, localFedoraServer)); this.idMapper = idMapper; this.invalidPattern = parsePattern("http://{local-fedora-server}/fedora/.*", localFedoraServer); }</code><technical_language>This be: new ArrayList<>()</technical_language>

Target:
public SelfReferencingURLMapper(final String localFedoraServer, final MigrationIDMapper idMapper) { this.contentPatterns = new ArrayList<>(); this.contentPatterns.add(parsePattern(OLD_DS_CONTENT_URL_PATTERN, localFedoraServer)); this.contentPatterns.add(parsePattern(NEW_DS_CONTENT_URL_PATTERN, localFedoraServer)); this.idMapper = idMapper; this.invalidPattern = parsePattern("http://{local-fedora-server}/fedora/.*", localFedoraServer); }
Source:
<code>private void fireReturnCallback(final Invoker<?> invoker, final Invocation invocation, final Object result) { final ConsumerMethodModel.AsyncMethodInfo asyncMethodInfo = getAsyncMethodInfo(invoker, invocation); <START> if (asyncMethodInfo == null) return; <END> final Method onReturnMethod = asyncMethodInfo.getOnreturnMethod(); final Object onReturnInst = asyncMethodInfo.getOnreturnInstance(); if (onReturnMethod == null && onReturnInst == null) { return; } if (onReturnMethod == null || onReturnInst == null) { throw new IllegalStateException("service:" + invoker.getUrl().getServiceKey() + " has a onreturn callback config , but no such " + (onReturnMethod == null ? "method" : "instance") + " found. url:" + invoker.getUrl()); } if (!onReturnMethod.isAccessible()) { onReturnMethod.setAccessible(true); } Object[] args = invocation.getArguments(); Object[] params; Class<?>[] rParaTypes = onReturnMethod.getParameterTypes(); if (rParaTypes.length > 1) { if (rParaTypes.length == 2 && rParaTypes[1].isAssignableFrom(Object[].class)) { params = new Object[2]; params[0] = result; params[1] = args; } else { params = new Object[args.length + 1]; params[0] = result; System.arraycopy(args, 0, params, 1, args.length); } } else { params = new Object[]{result}; } try { onReturnMethod.invoke(onReturnInst, params); } catch (InvocationTargetException e) { fireThrowCallback(invoker, invocation, e.getTargetException()); } catch (Throwable e) { fireThrowCallback(invoker, invocation, e); } }</code><technical_language>consider {...}</technical_language>

Target:
private void fireReturnCallback(final Invoker<?> invoker, final Invocation invocation, final Object result) { final ConsumerMethodModel.AsyncMethodInfo asyncMethodInfo = getAsyncMethodInfo(invoker, invocation); if (asyncMethodInfo == null) { return; } final Method onReturnMethod = asyncMethodInfo.getOnreturnMethod(); final Object onReturnInst = asyncMethodInfo.getOnreturnInstance(); if (onReturnMethod == null && onReturnInst == null) { return; } if (onReturnMethod == null || onReturnInst == null) { throw new IllegalStateException("service:" + invoker.getUrl().getServiceKey() + " has a onreturn callback config , but no such " + (onReturnMethod == null ? "method" : "instance") + " found. url:" + invoker.getUrl()); } if (!onReturnMethod.isAccessible()) { onReturnMethod.setAccessible(true); } Object[] args = invocation.getArguments(); Object[] params; Class<?>[] rParaTypes = onReturnMethod.getParameterTypes(); if (rParaTypes.length > 1) { if (rParaTypes.length == 2 && rParaTypes[1].isAssignableFrom(Object[].class)) { params = new Object[2]; params[0] = result; params[1] = args; } else { params = new Object[args.length + 1]; params[0] = result; System.arraycopy(args, 0, params, 1, args.length); } } else { params = new Object[]{result}; } try { onReturnMethod.invoke(onReturnInst, params); } catch (InvocationTargetException e) { fireThrowCallback(invoker, invocation, e.getTargetException()); } catch (Throwable e) { fireThrowCallback(invoker, invocation, e); } }
Source:
<code>public void testOracleExportAction() throws Exception { Path outputDir = dfsCluster.getFileSystem().getHomeDirectory(); OracleExportAction.OracleExportActionConfig oracleExportActionConfig = new OracleExportAction.OracleExportActionConfig(sshServer.getHost(), sshServer.getPort(), USER, PASSPHRASE, "system", "cask", "home", "sid", outputDir.toUri().toString() + "/tmp/OracleExportJunitTemp.csv", "select * from test;", "csv"); OracleExportAction oracleExportAction = new OracleExportAction(oracleExportActionConfig); MockActionContext mockActionContext = new MockActionContext(); oracleExportAction.run(mockActionContext); <START> Assert.assertTrue(fileSystem.exists(new Path(outputDir.toUri().toString() + "/tmp/OracleExportJunitTemp.csv"))); <END> }</code><technical_language>checking contents of file, reading data oracle, making exported file exists</technical_language>

Target:
public void testOracleExportAction() throws Exception { Path outputDir = dfsCluster.getFileSystem().getHomeDirectory(); OracleExportAction.OracleExportActionConfig oracleExportActionConfig = new OracleExportAction.OracleExportActionConfig(sshServer.getHost(), sshServer.getPort(), USER, "Password", PASSPHRASE, "", "", "system", "cask", "home", "sid", outputDir.toUri().toString() + "/tmp/OracleExportJunitTemp.csv", "select * from test;", "", "/tmp", "CSV"); OracleExportAction oracleExportAction = new OracleExportAction(oracleExportActionConfig); MockActionContext mockActionContext = new MockActionContext(); oracleExportAction.run(mockActionContext); Assert.assertTrue(fileSystem.exists(new Path(outputDir.toUri().toString() + "/tmp/OracleExportJunitTemp.csv"))); }
Source:
<code>protected String[] fillTypeCombo() { <START> ArrayList<String> <END> list = new ArrayList<>(); if(null != getType()) { for (AdapterTypePaletteEntry adaptertype : getAdapterTypes(getPalette())){ list.add(adaptertype.getLabel()); } } return list.toArray(new String[list.size()]); }</code><technical_language>change interface List</technical_language>

Target:
protected String[] fillTypeCombo() { List<String> list = new ArrayList<>(); if(null != getType()) { for (AdapterTypePaletteEntry adaptertype : getAdapterTypes(getPalette())){ list.add(adaptertype.getLabel()); } } return list.toArray(new String[list.size()]); }
Source:
<code>private synchronized User getOrCreateUser(String id, String email, String username) throws ServletException { try { return userManager.getById(id); } catch (NotFoundException e) { final UserImpl cheUser = new UserImpl(id, email, username, generate("", 12), emptyList()); try { return userManager.create(cheUser, false); } catch (ConflictException ex) { try { cheUser.setName(generate(cheUser.getName(), 4)); return userManager.create(cheUser, false); } catch (ServerException | ConflictException e1) { <START> throw new ServletException("Unable to create new user", e1); <END> } } catch (ServerException ex) { throw new ServletException("Unable to create new user", ex); } } catch (ServerException e) { throw new ServletException("Unable to get user", e); } }</code><technical_language>try catches this method unreadable. Please consider rewrite somehow, e.g. private synchronized User getOrCreateUser(String id, String email, String username) throws ServletException { try { Optional<User> user = doGetUser(id); if (user.isPresent()) { return user.get(); } final UserImpl cheUser = new UserImpl(id, email, username, generate("", 12), emptyList()); try { return userManager.create(cheUser, false); } catch (ConflictException ex) { cheUser.setName(generate(cheUser.getName(), 4)); return userManager.create(cheUser, false); } } catch (ServerException | ConflictException e) { throw new ServletException("Unable create new user", e); } } private Optional<User> doGetUser(String id) throws ServerException { try { return Optional.of(userManager.getById(id)); } catch (NotFoundException e) { return Optional.empty(); } }</technical_language>

Target:
private User getOrCreateUser(String id, String email, String username) throws ServerException, ConflictException { try { return userManager.getById(id); } catch (NotFoundException e) { synchronized (this) { final UserImpl cheUser = new UserImpl(id, email, username, generate("", 12), emptyList()); try { return userManager.create(cheUser, false); } catch (ConflictException ex) { cheUser.setName(generate(cheUser.getName(), 4)); return userManager.create(cheUser, false); } } } }
Source:
<code>private static PendingIntent buildIntent(Context context, long keyId) { Intent intent = new Intent(BROADCAST_ACTION_PASSPHRASE_CACHE_SERVICE); intent.putExtra(EXTRA_KEY_ID, keyId); Long _id = System.currentTimeMillis(); <START> return PendingIntent.getBroadcast(context, _id.intValue(), intent, <END> PendingIntent.FLAG_CANCEL_CURRENT); }</code><technical_language>this fix problem? I requestId parameter changed is related, please explain</technical_language>

Target:
private static PendingIntent buildIntent(Context context, long keyId) { Intent intent = new Intent(BROADCAST_ACTION_PASSPHRASE_CACHE_SERVICE); intent.putExtra(EXTRA_KEY_ID, keyId); return PendingIntent.getBroadcast(context, (int)keyId, intent, PendingIntent.FLAG_CANCEL_CURRENT); }
Source:
<code>public void commit(final Xid xid, final boolean onePhase) throws XAException { try { if (commitToEnlistment()) lookup(xid).commit(onePhase); } catch (XAException | RuntimeException exception) { if (resourceRegistry != null) resourceRegistry.resourceInDoubt(this); throw exception; } if (resourceRegistry != null) { resourceRegistry.removeResource(this); } else { for (XAResource xares : XAResourceRegistryProviderHolder.getInstance().getInDoubtXAResources()) { if (xares instanceof SubordinateXAResource) { SubordinateXAResource subordinateXares = (SubordinateXAResource) xares; <START> if (subordinateXares.resourceRegistry != null && subordinateXares.xid !=null <END> && SimpleXid.of(xid).equals(SimpleXid.of(subordinateXares.xid))) { subordinateXares.resourceRegistry.removeResource(subordinateXares); } } } } }</code><technical_language>Some formatting issues here</technical_language>

Target:
public void commit(final Xid xid, final boolean onePhase) throws XAException { try { if (commitToEnlistment()) lookup(xid).commit(onePhase); } catch (XAException | RuntimeException exception) { if (resourceRegistry != null) resourceRegistry.resourceInDoubt(this); throw exception; } if (resourceRegistry != null) { resourceRegistry.removeResource(this); } else { for (XAResource xares : XAResourceRegistryProviderHolder.getInstance().getInDoubtXAResources()) { if (xares instanceof SubordinateXAResource) { SubordinateXAResource subordinateXares = (SubordinateXAResource) xares; if (SimpleXid.of(xid).equals(SimpleXid.of(subordinateXares.xid))) { subordinateXares.resourceRegistry.removeResource(subordinateXares); } } } } }
Source:
<code>public void partDeactivated(IWorkbenchPart part) { String id = part.getSite().getId(); if (id.equals(getSite().getId())) { try (ByteArrayOutputStream bout = new ByteArrayOutputStream(); OutputStreamWriter writer = new OutputStreamWriter(bout)) { XMLMemento memento = XMLMemento.createWriteRoot("DebugViewMemento"); saveViewerState(memento); memento.save(writer); IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore(); String xmlString = bout.toString(); store.putValue(PREF_STATE_MEMENTO, xmlString); } catch (IOException e) { } } StringBuilder buffer= new StringBuilder(); for (String <START> string : <END> fDebugToolbarPerspectives) { buffer.append(string).append(','); } getPreferenceStore().setValue(IDebugPreferenceConstants.DEBUG_VIEW_TOOLBAR_HIDDEN_PERSPECTIVES, buffer.toString()); super.partDeactivated(part); }</code><technical_language>rename perspectiveId</technical_language>

Target:
public void partDeactivated(IWorkbenchPart part) { String id = part.getSite().getId(); if (id.equals(getSite().getId())) { try (ByteArrayOutputStream bout = new ByteArrayOutputStream(); OutputStreamWriter writer = new OutputStreamWriter(bout)) { XMLMemento memento = XMLMemento.createWriteRoot("DebugViewMemento"); saveViewerState(memento); memento.save(writer); IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore(); String xmlString = bout.toString(); store.putValue(PREF_STATE_MEMENTO, xmlString); } catch (IOException e) { } } StringBuilder buffer= new StringBuilder(); for (String perspectiveId : fDebugToolbarPerspectives) { buffer.append(perspectiveId).append(','); } getPreferenceStore().setValue(IDebugPreferenceConstants.DEBUG_VIEW_TOOLBAR_HIDDEN_PERSPECTIVES, buffer.toString()); super.partDeactivated(part); }
Source:
<code>public Builder addInitializerBlock(CodeBlock block) { <START> if (!(kind == Kind.CLASS || kind == Kind.ENUM)) { <END> throw new UnsupportedOperationException(kind + " can't have initializer blocks"); } initializerBlock.add("{\n") .indent() .add(block) .unindent() .add("}\n"); return this; }</code><technical_language>Mind simplifying this expression? if (kind != Kind.CLASS && kind != Kind.ENUM) {</technical_language>

Target:
public Builder addInitializerBlock(CodeBlock block) { if ((kind != Kind.CLASS && kind != Kind.ENUM)) { throw new UnsupportedOperationException(kind + " can't have initializer blocks"); } initializerBlock.add("{\n") .indent() .add(block) .unindent() .add("}\n"); return this; }
Source:
<code>public void init() { orchestrator.resetData(); ItUtils.restoreProfile(orchestrator, getClass().getResource("/authorisation/one-issue-per-line-profile.xml")); orchestrator.getServer().provisionProject("privateProject", "PrivateProject"); ItUtils.newAdminWsClient(orchestrator).projects().changeVisibility(new ChangeVisibilityRequest("privateProject", PRIVATE)); orchestrator.getServer().associateProjectToQualityProfile("privateProject", "xoo", "one-issue-per-line"); SonarScanner privateProject = SonarScanner.create(projectDir("shared/xoo-sample")) .setProperty("sonar.projectKey", "privateProject") .setProperty("sonar.projectName", "PrivateProject"); orchestrator.executeBuild(privateProject); orchestrator.getServer().provisionProject("publicProject", "PublicProject"); <START> orchestrator.getServer().associateProjectToQualityProfile("publicProject", "xoo", "one-issue-per-line"); <END> SonarScanner publicProject = SonarScanner.create(projectDir("shared/xoo-sample")) .setProperty("sonar.projectKey", "publicProject") .setProperty("sonar.projectName", "PublicProject"); orchestrator.executeBuild(publicProject); }</code><technical_language>_could_ set visibility explicitly public. (Nice have)</technical_language>

Target:
public void init() { orchestrator.resetData(); ItUtils.restoreProfile(orchestrator, getClass().getResource("/authorisation/one-issue-per-line-profile.xml")); orchestrator.getServer().provisionProject("privateProject", "PrivateProject"); ItUtils.newAdminWsClient(orchestrator).projects().updateVisibility(new UpdateVisibilityRequest("privateProject", PRIVATE)); orchestrator.getServer().associateProjectToQualityProfile("privateProject", "xoo", "one-issue-per-line"); SonarScanner privateProject = SonarScanner.create(projectDir("shared/xoo-sample")) .setProperty("sonar.projectKey", "privateProject") .setProperty("sonar.projectName", "PrivateProject"); orchestrator.executeBuild(privateProject); orchestrator.getServer().provisionProject("publicProject", "PublicProject"); orchestrator.getServer().associateProjectToQualityProfile("publicProject", "xoo", "one-issue-per-line"); SonarScanner publicProject = SonarScanner.create(projectDir("shared/xoo-sample")) .setProperty("sonar.projectKey", "publicProject") .setProperty("sonar.projectName", "PublicProject"); orchestrator.executeBuild(publicProject); }
Source:
<code>public BuildCommand updateTo(String baseDir, RevisionContext revisionContext) { Revision revision = revisionContext.getLatestRevision(); String workingDir = material.workingdir(new File(baseDir)).getPath(); UrlArgument url = material.getUrlArgument(); return compose( echoWithPrefix(format("Start updating %s at revision %s from %s", material.updatingTarget(), revision.getRevision(), url.forDisplay())), secret(url.forCommandline(), url.forDisplay()), secret(material.getPassword(), "*********************"), <START> secret(material.currentPassword(), "*********************"), <END> cleanupAndUpdate(workingDir, revision).setTest(shouldDoCleanupAndUpdate(workingDir)), freshCheckout(workingDir, revision).setTest(isNotRepository(workingDir)), freshCheckout(workingDir, revision).setTest(test("-nd", workingDir)), freshCheckout(workingDir, revision).setTest(repoUrlChanged(workingDir)), echoWithPrefix(format("Done.\n")) ); }</code><technical_language>I need getPassword currentPassword. In fact, currentPassword method completely removed</technical_language>

Target:
public BuildCommand updateTo(String baseDir, RevisionContext revisionContext) { Revision revision = revisionContext.getLatestRevision(); String workingDir = material.workingdir(new File(baseDir)).getPath(); UrlArgument url = material.getUrlArgument(); return compose( echoWithPrefix(format("Start updating %s at revision %s from %s", material.updatingTarget(), revision.getRevision(), url.forDisplay())), secret(url.forCommandline(), url.forDisplay()), secret(material.getPassword(), "*********************"), cleanupAndUpdate(workingDir, revision).setTest(shouldDoCleanupAndUpdate(workingDir)), freshCheckout(workingDir, revision).setTest(isNotRepository(workingDir)), freshCheckout(workingDir, revision).setTest(test("-nd", workingDir)), freshCheckout(workingDir, revision).setTest(repoUrlChanged(workingDir)), echoWithPrefix(format("Done.\n")) ); }
Source:
<code>public void preLightning(EntityLightningBolt lightningBolt, CallbackInfo callbackInfo) { if (!this.world.isRemote) { this.originalLightning = DamageSource.LIGHTNING_BOLT; <START> DamageSource.IN_FIRE = new EntityDamageSource("lightningBolt", lightningBolt); <END> } }</code><technical_language>set this back</technical_language>

Target:
public void preLightning(EntityLightningBolt lightningBolt, CallbackInfo callbackInfo) { if (!this.world.isRemote) { this.originalLightning = DamageSource.LIGHTNING_BOLT; DamageSource.LIGHTNING_BOLT = new EntityDamageSource("lightningBolt", lightningBolt); } }
Source:
<code>V get() { final V poolVal; synchronized (this) { while (!closed && objectMap.size() == 0 && deficit == 0) { try { this.wait(); } catch (InterruptedException e) { Thread.interrupted(); return null; } } if (closed) { log.info(String.format("get() called even though I'm closed. key[%s]", key)); return null; } else if (!objectMap.isEmpty()) <START> { <END> Map.Entry<Long,V> firstEntry = objectMap.pollFirstEntry(); if(System.nanoTime() - firstEntry.getKey() > maxTimeInNanosToHold) { factory.close(firstEntry.getValue()); poolVal = factory.generate(key); } else{ poolVal = firstEntry.getValue(); } } else if (deficit > 0) { deficit --; poolVal = null; } else { throw new IllegalStateException("WTF?! No objects left, and no object deficit. This is probably a bug."); } } final V retVal; try { if (poolVal != null && factory.isGood(poolVal)) { retVal = poolVal; } else { if (poolVal != null) { factory.close(poolVal); } retVal = factory.generate(key); } } catch (Throwable e) { synchronized (this) { deficit++; this.notifyAll(); } throw Throwables.propagate(e); } return retVal; }</code><technical_language>formatting</technical_language>

Target:
V get() { final V poolVal; synchronized (this) { while (!closed && resourceHolderList.size() == 0 && deficit == 0) { try { this.wait(); } catch (InterruptedException e) { Thread.interrupted(); return null; } } if (closed) { log.info(String.format("get() called even though I'm closed. key[%s]", key)); return null; } else if (!resourceHolderList.isEmpty()) { ResourceHolder<V> holder = resourceHolderList.removeFirst(); if (System.currentTimeMillis() - holder.getLastAccessedTime() > unusedResourceTimeoutMillis) { factory.close(holder.getResource()); poolVal = factory.generate(key); } else { poolVal = holder.getResource(); } } else if (deficit > 0) { deficit--; poolVal = null; } else { throw new IllegalStateException("WTF?! No objects left, and no object deficit. This is probably a bug."); } } final V retVal; try { if (poolVal != null && factory.isGood(poolVal)) { retVal = poolVal; } else { if (poolVal != null) { factory.close(poolVal); } retVal = factory.generate(key); } } catch (Throwable e) { synchronized (this) { deficit++; this.notifyAll(); } throw Throwables.propagate(e); } return retVal; }
Source:
<code>private void updateVmTemplate() { vmHandler.updateVmInitToDB(getVmTemplate()); vmTemplateDao.update(getVmTemplate()); getVmDeviceUtils().updateSmartcardDevice(getVmTemplateId(), getParameters().getVmTemplateData().isSmartcardEnabled()); getVmDeviceUtils().updateSoundDevice(oldTemplate, getVmTemplate(), getVmTemplate().getCompatibilityVersion(), getParameters().isSoundDeviceEnabled()); getVmDeviceUtils().updateConsoleDevice(getVmTemplateId(), getParameters().isConsoleEnabled()); <START> getVmDeviceUtils().updateUsbSlots(oldTemplate, getVmTemplate()); <END> getVmDeviceUtils().updateVirtioScsiController(getVmTemplate(), getParameters().isVirtioScsiEnabled()); if (getParameters().isBalloonEnabled() != null) { getVmDeviceUtils().updateMemoryBalloon(getVmTemplateId(), getParameters().isBalloonEnabled()); } if (getParameters().getVmTemplateData().getDefaultDisplayType() == DisplayType.none) { getVmDeviceUtils().removeVideoDevices(getVmTemplateId()); } }</code><technical_language>similar</technical_language>

Target:
private void updateVmTemplate() { vmHandler.updateVmInitToDB(getVmTemplate()); vmTemplateDao.update(getVmTemplate()); getVmDeviceUtils().updateSmartcardDevice(getVmTemplateId(), getParameters().getVmTemplateData().isSmartcardEnabled()); getVmDeviceUtils().updateSoundDevice(oldTemplate, getVmTemplate(), getVmTemplate().getCompatibilityVersion(), getParameters().isSoundDeviceEnabled()); getVmDeviceUtils().updateConsoleDevice(getVmTemplateId(), getParameters().isConsoleEnabled()); if (oldTemplate.getUsbPolicy() != getVmTemplate().getUsbPolicy()) { getVmDeviceUtils().updateUsbSlots(oldTemplate, getVmTemplate()); } getVmDeviceUtils().updateVirtioScsiController(getVmTemplate(), getParameters().isVirtioScsiEnabled()); if (getParameters().isBalloonEnabled() != null) { getVmDeviceUtils().updateMemoryBalloon(getVmTemplateId(), getParameters().isBalloonEnabled()); } if (getParameters().getVmTemplateData().getDefaultDisplayType() == DisplayType.none) { getVmDeviceUtils().removeVideoDevices(getVmTemplateId()); } }
Source:
<code>public void call(final Subscriber<? super T> subscriber) { subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { if (selection.choice.get() != null) { selection.choice.get().unsubscribe(); } if(!selection.ambSubscribers.isEmpty()) { for (AmbSubscriber<T> other : selection.ambSubscribers) { other.unsubscribe(); } selection.ambSubscribers.clear(); } } })); subscriber.setProducer(new Producer() { private final AtomicBoolean subscribedToSources = new AtomicBoolean(false); @Override public void request(long n) { if (selection.choice.get() != null) { selection.choice.get().requestMore(n); } else if (subscribedToSources.compareAndSet(false, true)){ for (Observable<? extends T> source : sources) { if (subscriber.isUnsubscribed()) { return; } AmbSubscriber<T> ambSubscriber = new AmbSubscriber<T>(n, subscriber, selection); selection.ambSubscribers.add(ambSubscriber); if (selection.choice.get() != null) { selection.unsubscribeOthers(selection.choice.get()); return; } source.unsafeSubscribe(ambSubscriber); } } else { <START> for (AmbSubscriber<T> ambSubscriber: selection.ambSubscribers) { <END> if (!ambSubscriber.isUnsubscribed()) { if (selection.choice.get() == ambSubscriber) { ambSubscriber.requestMore(n); return; } else { ambSubscriber.requestMore(n); } } } } } }); }</code><technical_language>This run concurrently subscription loop some subscribers get newer requests time. simplest fix is subscribe AmbSubscriber in call() of operator 0 initial requests subsequent request() target winner additional race. other is get some complicated serialization logic</technical_language>

Target:
public void call(final Subscriber<? super T> subscriber) { subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { AmbSubscriber<T> c; if ((c = choice.get()) != null) { c.unsubscribe(); } unsubscribeAmbSubscribers(selection.ambSubscribers); } })); for (Observable<? extends T> source : sources) { if (subscriber.isUnsubscribed()) { break; } AmbSubscriber<T> ambSubscriber = new AmbSubscriber<T>(0, subscriber, selection); selection.ambSubscribers.add(ambSubscriber); AmbSubscriber<T> c; if ((c = choice.get()) != null) { selection.unsubscribeOthers(c); return; } source.unsafeSubscribe(ambSubscriber); } if (subscriber.isUnsubscribed()) { unsubscribeAmbSubscribers(selection.ambSubscribers); } subscriber.setProducer(new Producer() { @Override public void request(long n) { final AmbSubscriber<T> c; if ((c = choice.get()) != null) { c.requestMore(n); } else { for (AmbSubscriber<T> ambSubscriber: selection.ambSubscribers) { if (!ambSubscriber.isUnsubscribed()) { if (choice.get() == ambSubscriber) { ambSubscriber.requestMore(n); return; } else { ambSubscriber.requestMore(n); } } } } } }); }
Source:
<code>public void handleNonExpiry403NoReason() throws Exception { mockWebServer.enqueue(MockWebServerResources.OK_COOKIE); mockWebServer.enqueue(new MockResponse().setResponseCode(403).setBody ("{\"error\":\"403_not_expired_test\"}\r\n")); try { CloudantClient c = CloudantClientHelper.newMockWebServerClientBuilder(mockWebServer) .username("a") .password("b") .build(); c.executeRequest(Http.GET(c.getBaseUri())); fail("A 403 not due to cookie expiry should result in a CouchDbException"); } catch (CouchDbException e) { <START> e.printStackTrace(); <END> assertNotNull("The error should not be null", e.getError()); assertEquals("The error message should be the expected one", "403_not_expired_test", e .getError()); } }</code><technical_language>Assert reason is null</technical_language>

Target:
public void handleNonExpiry403NoReason() throws Exception { basic403Test("403_not_expired_test", null, 2); }
Source:
<code>private EhcacheEntityResponse invokeServerStoreOperation(ServerStoreOpMessage message) { try { switch (message.operation()) { <START> case GET: return EhcacheEntityResponse.response(stores.get(message.getCacheId()).get(message.getKey())); <END> case APPEND: stores.get(message.getCacheId()).append(message.getKey(), ((ServerStoreOpMessage.AppendMessage)message).getPayload()); return EhcacheEntityResponse.success(); case GETANDAPPEND: return EhcacheEntityResponse.response(stores.get(message.getCacheId()).getAndAppend(message.getKey(), ((ServerStoreOpMessage.GetAndAppendMessage)message).getPayload())); case REPLACE: ServerStoreOpMessage.ReplaceAtHeadMessage replaceAtHeadMessage = (ServerStoreOpMessage.ReplaceAtHeadMessage)message; stores.get(replaceAtHeadMessage.getCacheId()).replaceAtHead(replaceAtHeadMessage.getKey(), replaceAtHeadMessage.getExpect(), replaceAtHeadMessage.getUpdate()); return EhcacheEntityResponse.success(); default: throw new IllegalArgumentException("Unknown Server Store operation " + message); } } catch (Exception e) { return EhcacheEntityResponse.failure(e); } }</code><technical_language>stores.get wrapped throw a meaningful exception in case is store. caller get a useless NPE happened other side of network ..</technical_language>

Target:
private EhcacheEntityResponse invokeServerStoreOperation(ServerStoreOpMessage message) { try { ServerStore cacheStore = stores.get(message.getCacheId()); if (cacheStore == null) { throw new IllegalStateException("Server Store not present for cacheId :" + message.getCacheId()); } switch (message.operation()) { case GET: return EhcacheEntityResponse.response(cacheStore.get(message.getKey())); case APPEND: cacheStore.append(message.getKey(), ((ServerStoreOpMessage.AppendMessage)message).getPayload()); return EhcacheEntityResponse.success(); case GET_AND_APPEND: return EhcacheEntityResponse.response(cacheStore.getAndAppend(message.getKey(), ((ServerStoreOpMessage.GetAndAppendMessage)message).getPayload())); case REPLACE: ServerStoreOpMessage.ReplaceAtHeadMessage replaceAtHeadMessage = (ServerStoreOpMessage.ReplaceAtHeadMessage)message; cacheStore.replaceAtHead(replaceAtHeadMessage.getKey(), replaceAtHeadMessage.getExpect(), replaceAtHeadMessage.getUpdate()); return EhcacheEntityResponse.success(); default: throw new IllegalArgumentException("Unknown Server Store operation " + message); } } catch (Exception e) { return EhcacheEntityResponse.failure(e); } }
Source:
<code>public void addLink(Context context) { final Builder spanBuilder = getSpanBuilder(PARENT_SPAN_KEY, context); final SpanContext spanContext = getSpanContext(context); if (spanContext == null) { logger.warning("Failed to find span context to link it."); return; } spanBuilder.addLink(spanContext); <START> spanBuilder.startSpan(); <END> }</code><technical_language>if want add more link? start span</technical_language>

Target:
public void addLink(Context context) { final Builder spanBuilder = getSpanBuilder(PARENT_SPAN_KEY, context); final SpanContext spanContext = getSpanContext(context); if (spanContext == null) { logger.warning("Failed to find span context to link it."); return; } spanBuilder.addLink(spanContext); }
Source:
<code>public boolean hasBackCameraFlash() { <START> if (hasBackCamera()) { <END> return backCameraInformation.flashAvailable; } return false; }</code><technical_language>"early return" here: return hasBackCamera() && backCameraInformation.flashAvailable: Java evaluates right hand side of condition first, null pointer exception occur here</technical_language>

Target:
public boolean hasBackCameraFlash() { return (hasBackCamera() && backCameraInformation.flashAvailable); }
Source:
<code>public Links getLinks() { <START> if (groups.size() == 0) { <END> return null; } return groups.get(0).getLinks(); }</code><technical_language>groups.isEmpty() is a</technical_language>

Target:
public Links getLinks() { if (groups.isEmpty()) { return null; } return groups.get(0).getLinks(); }